Hi,
I am getting error at below method. this method is calling in upload method.
public static object m_ImpersonateWithDelegate(string domainName, string userName, string passWord, ImpersonationObject impDelegate, int logonType) { LogonType = logonType; object retObject = null;
IntPtr tokenHandle = new IntPtr(0); IntPtr dupeTokenHandle = new IntPtr(0);
// Get the user token for the specified user, domain, and password using the // unmanaged LogonUser method. // The local machine name can be used for the domain name to impersonate a user on this machine.
//This parameter causes LogonUser to create a primary token. const int SecurityImpersonationLevel = 2;
tokenHandle = IntPtr.Zero; dupeTokenHandle = IntPtr.Zero;
// Call LogonUser to obtain a handle to an access token. //bool returnValue = LogonUser(userName, domainName, passWord, logonType, L ...

Go to the complete details ...