C# Class projectBM.impersonate

Inheritance: IDisposable
Afficher le fichier Open project: zettasolutions/projectBM

Méthodes publiques

Méthode Description
Dispose ( ) : void
impersonate ( ) : System
impersonate ( string domainName, string userName, string password ) : System

Constructor. Starts the impersonation with the given credentials. Please note that the account that instantiates the Impersonator class needs to have the 'Act as part of operating system' privilege set.

Private Methods

Méthode Description
CloseHandle ( IntPtr handle ) : bool
DuplicateToken ( IntPtr hToken, int impersonationLevel, IntPtr &hNewToken ) : int
ImpersonateValidUser ( string domain, string userName, string password ) : void

Does the actual impersonation.

LogonUser ( string lpszUserName, string lpszDomain, string lpszPassword, int dwLogonType, int dwLogonProvider, IntPtr &phToken ) : int
RevertToSelf ( ) : bool
UndoImpersonation ( ) : void

Reverts the impersonation.

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

impersonate() public méthode

public impersonate ( ) : System
Résultat System

impersonate() public méthode

Constructor. Starts the impersonation with the given credentials. Please note that the account that instantiates the Impersonator class needs to have the 'Act as part of operating system' privilege set.
public impersonate ( string domainName, string userName, string password ) : System
domainName string The domain name of the user to act as.
userName string The name of the user to act as.
password string The password of the user to act as.
Résultat System