Author: BenHines | Posted on: 7/13/2009 1:56:19 PM | Views : 408

Hi,
I have an ASP .NET web service that needs to have access to network resources, specifically a mapped drive.  The access is only needed for one of the methods the service provides. So, I wanted to use user impersonation in the method in question so that it would have the required access.  After doing some reading in the MSDN, it seems that I want to user the LogonUser Windows API along with WindowsImpersonationContext and WindowsIdentity. Also, the MSDN mentions that to gain access to network resource, you should request an interactive login session type.  The problem I'm having is that I can only get the LogonUser API to succeed for a network session type, which doesn't let me see the mapped network resource. 
I wondered if it maybe something strange with the ASPNET user.  So, I created a Windows Forms app that does the same thing.  Of course, when I run this app, the 'current' user is my local user and not the ASPNET us ...

Go to the complete details ...