N
NagaKiran
Hi
I have been worked with DotNet windows application.
There I didnot get this problem..
When I am working on web application, It is giving problem. I describing the
problem here.
I want to create a folder.
For this I have imported System.IO namespace..
Imports System.IO
To create a directory I am using the Directory class which is defined in
above mentioned namespace.
If Not Directory.Exists(Server.MapPath("\Projects")) Then
Directory.CreateDirectory(Server.MapPath("\Projects"))
End If
I wrote that code in page_load event..
When I tried to run the application it is giving the following error.
How to overcome this..
It seems like a simple one.. But kindly help me in this...
Thanks in advance
NagaKiran
Server Error in '/NES' Application.
----------------------------------------------------------------------------
----
Access to the path "c:\inetpub\wwwroot\Projects" 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
"c:\inetpub\wwwroot\Projects" 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 104:
Line 105: If Not Directory.Exists(Server.MapPath("\Projects")) Then
Line 106: Directory.CreateDirectory(Server.MapPath("\Projects"))
Line 107: End If
Line 108: If Not Directory.Exists(proLocation) Then
Source File: E:\Projects\pms\NES\pmsAddNewProj.aspx.vb Line: 106
I have been worked with DotNet windows application.
There I didnot get this problem..
When I am working on web application, It is giving problem. I describing the
problem here.
I want to create a folder.
For this I have imported System.IO namespace..
Imports System.IO
To create a directory I am using the Directory class which is defined in
above mentioned namespace.
If Not Directory.Exists(Server.MapPath("\Projects")) Then
Directory.CreateDirectory(Server.MapPath("\Projects"))
End If
I wrote that code in page_load event..
When I tried to run the application it is giving the following error.
How to overcome this..
It seems like a simple one.. But kindly help me in this...
Thanks in advance
NagaKiran
Server Error in '/NES' Application.
----------------------------------------------------------------------------
----
Access to the path "c:\inetpub\wwwroot\Projects" 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
"c:\inetpub\wwwroot\Projects" 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 104:
Line 105: If Not Directory.Exists(Server.MapPath("\Projects")) Then
Line 106: Directory.CreateDirectory(Server.MapPath("\Projects"))
Line 107: End If
Line 108: If Not Directory.Exists(proLocation) Then
Source File: E:\Projects\pms\NES\pmsAddNewProj.aspx.vb Line: 106