Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 19, 2012 07:22 AM by molly_c
Dec 15, 2012 02:54 AM|LINK
I need the application impersonate UserA to access a shared folder.
I modify Web.config file to impersonate a userA and the web application access the shared folder successfully.
<identity impersonate="true" userName="domain\userA" password="password" />
But I cannot Impersonate the userA in Code.
<identity impersonate="true" />
impersonationContext = WindowsIdentity.GetCurrent().Impersonate();
After the application access the shared folder, I check the security event on the shared folder's server, it showed anonymous logon. (I checked the WindowsIdentity.GetCurrent() is userA.)
What should I do? Thanks!!
Dec 17, 2012 09:37 AM|LINK
Looks weird... Tell us more inforamtion about your issue.
Dec 19, 2012 06:44 AM|LINK
Could you tell me what information I should provide? Thanks!
Dec 19, 2012 07:22 AM|LINK
Something like authentication or something else...
Your step is total same as "How to implement impersonation in an ASP.NET application" said.. Im not sure where is your error part..
if you dont' set identity impersonate = "True" in web.config, does your code work?