Visualizzazione dei risultati da 1 a 5 su 5

Discussione: accesso negato

  1. #1

    accesso negato

    Server Error in '/mappoint' Application.
    Accesso negato.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.UnauthorizedAccessException: Accesso negato.

    The ASP.NET process is not authorized to access the requested resource. For security reasons the default ASP.NET process identity is '{machinename}\ASPNET', which has limited privileges. Consider granting access rights to the resource to the ASP.NET process identity.

    To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the "{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the Write box in the Allow column.

    Source Error: Line 202:

    MapPoint.Application objApp = new MapPoint.Application();

    perche mi da errore la stessa stringa di connessione al mappoint2002 se in locale con una windows form tutto funziona benissimo?

  2. #2
    devo impostare delle autorizzazioni? sulla cartella della webform1.aspx le ho date tutte

  3. #3

    listato pagina

    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.IO;
    using MapPoint;
    namespace mappoint_asp
    {
    /// <summary>
    /// Summary description for WebForm1.
    /// </summary>
    public class WebForm1 : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.Button Button1;
    protected System.Web.UI.WebControls.TextBox TextBox1;
    protected System.Web.UI.WebControls.TextBox TextBox2;
    protected System.Web.UI.WebControls.TextBox TextBox3;
    protected System.Web.UI.WebControls.TextBox TextBox4;
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.Label Label2;
    protected System.Web.UI.WebControls.Label Label3;
    protected System.Web.UI.WebControls.Label Label4;
    protected System.Web.UI.WebControls.Label Label5;
    protected System.Web.UI.WebControls.Label Label6;
    protected System.Web.UI.WebControls.Label Label7;
    protected System.Web.UI.WebControls.TextBox TextBox6;
    protected System.Web.UI.WebControls.Button Button2;
    protected System.Web.UI.WebControls.TextBox TextBox5;

    public WebForm1()
    {
    Page.Init += new System.EventHandler(Page_Init);

    }

    private void Page_Load(object sender, System.EventArgs e)
    {

    // Put user code to initialize the page here
    }

    private void Page_Init(object sender, EventArgs e)
    {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    }

    #region Web Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
    this.Button1.Click += new System.EventHandler(this.Button1_Click);
    this.TextBox5.TextChanged += new System.EventHandler(this.TextBox5_TextChanged);
    this.Button2.Click += new System.EventHandler(this.Button2_Click);
    this.Load += new System.EventHandler(this.Page_Load);

    }
    #endregion

    private void TextBox5_TextChanged(object sender, System.EventArgs e)
    {

    }

    private void Button1_Click(object sender, System.EventArgs e)
    {
    FileInfo f = new FileInfo("C:\\Inetpub\\wwwroot\\mappoint\\dati2001 2002.txt");
    StreamWriter writer =f.CreateText();
    writer.WriteLine(TextBox1.Text);
    writer.WriteLine(TextBox2.Text);
    writer.WriteLine(TextBox3.Text);
    writer.WriteLine(TextBox4.Text);
    writer.WriteLine(TextBox5.Text);
    writer.WriteLine(TextBox6.Text);
    writer.Close();
    }

    private void Button2_Click(object sender, System.EventArgs e)
    {DateTime t=DateTime .Now;
    string s1,s2,s3,s4,s5,s6;
    string input;
    s1="";
    s2="";
    s3="";
    s4="";
    s5="";
    s6="";
    // formato in cui salvare la cartina
    MapPoint.GeoSaveFormat ss;

    bool c=false;
    ss=MapPoint.GeoSaveFormat.geoFormatHTMLMapAndDirec tions;


    //leggo i dati dal file.....e verifico esistenza file servizio

    c=File.Exists("C:\\Inetpub\\wwwroot\\mappoint\\ser vizio.txt");
    if (c==true)
    {

    MapPoint.Application objApp = new MapPoint.Application();
    MapPoint.FindResults re ;
    StreamReader sr = File.OpenText("C:\\Inetpub\\wwwroot\\mappoint\\dat i20012002.txt");
    if((input=sr.ReadLine())!=null)
    {s1=input;}
    if((input=sr.ReadLine())!=null)
    {s2=input;}
    if((input=sr.ReadLine())!=null)
    {s3=input;}
    if((input=sr.ReadLine())!=null)
    {s4=input;}
    if((input=sr.ReadLine())!=null)
    {s5=input;}
    if((input=sr.ReadLine())!=null)
    {s6=input;}

    objApp.UserControl=true;
    objApp.Visible = false;
    re=objApp.ActiveMap.FindAddressResults(s3,s1,s6,s4 ,s5,s2);
    foreach(MapPoint.Location lo1 in re)
    {
    objApp.ActiveMap.AddPushpin(lo1,lo1.Name);
    lo1.GoTo();
    lo1.Select();
    objApp.ActiveMap.ZoomIn() ;
    objApp.ActiveMap.ZoomIn() ;
    break;
    }
    objApp.UserControl=true;
    objApp.ActiveMap.SaveAs ("C:\\Inetpub\\wwwroot\\mappoint\\prova2",ss,true) ;
    objApp.ActiveMap.Saved=true;
    sr.Close();
    File.Delete("C:\\Inetpub\\wwwroot\\mappoint\\servi zio.txt");
    }
    }
    }

    }

  4. #4

  5. #5
    il problema nn sono i file ma l'accesso al mappoint!sai come si risolve questo problema ?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.