C# Class ImpersonationUtil, code

Impersonate a windows logon.
Afficher le fichier Open project: shendongnian/code

Méthodes publiques

Méthode Description
Impersonate ( string logon, string password, string domain ) : bool

Impersonate given logon information.

UnImpersonate ( ) : void

Unimpersonate.

Private Methods

Méthode Description
DuplicateToken ( IntPtr, hToken, int impersonationLevel, IntPtr, &hNewToken ) : int
LogonUser ( string lpszUserName, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, IntPtr, &phToken ) : int

Method Details

Impersonate() public static méthode

Impersonate given logon information.
public static Impersonate ( string logon, string password, string domain ) : bool
logon string Windows logon name.
password string password
domain string domain name
Résultat bool

UnImpersonate() public static méthode

Unimpersonate.
public static UnImpersonate ( ) : void
Résultat void