I have developed a login page in asp.net which impersonate the user using ASP.Net IMPERSONATION and then redirect it to the specified page where i m giving IP Adress to my webserver and then reading a file from "C" Drive
of my webserver. The code and impersoation works fine as i run it in Visual Studio 2005 i m impersonation using Domain Administrator account who can acess any drive of the entire network but as soon i host it on my local pc and try to run it using
localhost it gives me System.UnauthorizedAccessException:
Access to the path '\\WebServer\c$\Test.txt
I m trying to play with IIS 5.0 secuurity tab for this application but still not getting it to work plz help me Thanks in advance
As suggested, it's probably caused by the user permission. Please impersonate a specific domain user which can access the shared domain resources for test.
miwasi2002
Member
5 Points
30 Posts
ON LOCALHOST System.UnauthorizedAccessException:
Jun 05, 2009 05:26 AM|LINK
I have developed a login page in asp.net which impersonate the user using ASP.Net IMPERSONATION and then redirect it to the specified page where i m giving IP Adress to my webserver and then reading a file from "C" Drive of my webserver. The code and impersoation works fine as i run it in Visual Studio 2005 i m impersonation using Domain Administrator account who can acess any drive of the entire network but as soon i host it on my local pc and try to run it using localhost it gives me System.UnauthorizedAccessException: Access to the path '\\WebServer\c$\Test.txt
I m trying to play with IIS 5.0 secuurity tab for this application but still not getting it to work plz help me Thanks in advance
localhost
abinashpatra
Participant
984 Points
284 Posts
Re: ON LOCALHOST System.UnauthorizedAccessException:
Jun 05, 2009 12:06 PM|LINK
Hello,
Check the User under which the app is running is added in the security setting of the concerned folder and given appropriate access.
Check this first.
Abinash Patra
Please mark the post as answer, if you find this useful.
Wencui Qian ...
All-Star
56784 Points
5796 Posts
Microsoft
Re: ON LOCALHOST System.UnauthorizedAccessException:
Jun 09, 2009 06:48 AM|LINK
Hi miwasi2002,
As suggested, it's probably caused by the user permission. Please impersonate a specific domain user which can access the shared domain resources for test.
You could also use this code to know which account is running the asp.net process:
Thanks.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework