Server Error in '/' Application.

Access to the path "E:\sites\www34\timhines\db\counterwap.txt" 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 "E:\sites\www34\timhines\db\counterwap.txt" 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) 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 write access to a file, right-click the file in 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 72: 
Line 73:         sFile = Server.MapPath("\timhines\db\counterwap.txt")
Line 74:         objReader = File.OpenText(sFile)
Line 75:         sCount = objReader.ReadToEnd()
Line 76:         objReader.Close

Source File: E:\sites\www34\timhines\wap.aspx    Line: 74

Stack Trace:


[UnauthorizedAccessException: Access to the path "E:\sites\www34\timhines\db\counterwap.txt" is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String str) +362
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) +851
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) +43
   System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +78
   System.IO.StreamReader..ctor(String path) +97
   System.IO.File.OpenText(String path) +29
   ASP.wap_aspx.Page_Load() in E:\sites\www34\timhines\wap.aspx:74
   System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.MobileControls.MobilePage.OnLoad(EventArgs e) +147
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750


Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407