I used the following lines (or variants thereof) to create a file in output mode:
Dim writer As StreamWriter
writer = New StreamWriter(Request.PhysicalApplicationPath & "NewFile.txt", False)
Whether the file exists or not, I receive the following runtime error:
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 "c:\inetpub\wwwroot\KICMG\WebApplication1\NewFile.txt" is denied.
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.
When I attempt to follow the instructions in the last paragraph above, I do not get a Security tab in Properties. Can anyone suggest a solution to this problem? Thanks.
Dim writer As StreamWriter
writer = New StreamWriter(Request.PhysicalApplicationPath & "NewFile.txt", False)
Whether the file exists or not, I receive the following runtime error:
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 "c:\inetpub\wwwroot\KICMG\WebApplication1\NewFile.txt" is denied.
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.
When I attempt to follow the instructions in the last paragraph above, I do not get a Security tab in Properties. Can anyone suggest a solution to this problem? Thanks.