C# 클래스 YetAnotherRelogger.Helpers.Tools.Impersonator

Allows code to be executed under the security context of a specified user account.
Implements IDispose, so can be used via a using-directive or method calls; ... var imp = new Impersonator( "myUsername", "myDomainname", "myPassword" ); imp.UndoImpersonation(); ... var imp = new Impersonator(); imp.Impersonate("myUsername", "myDomainname", "myPassword"); imp.UndoImpersonation(); ... using ( new Impersonator( "myUsername", "myDomainname", "myPassword" ) ) { ... [code that executes under the new context] ... } ...
상속: IDisposable
파일 보기 프로젝트 열기: sinterlkaas/YetAnotherRelogger 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Impersonate ( string userName, string domainName, string password ) : void

Impersonates the specified user account.

Impersonate ( string userName, string domainName, string password, LogonType logonType, LogonProvider logonProvider ) : void

Impersonates the specified user account.

Impersonator ( ) : System

Initializes a new instance of the Impersonator class.

Impersonator ( string userName, string domainName, string password ) : System

Begins impersonation with the given credentials.

Impersonator ( string userName, string domainName, string password, LogonType logonType, LogonProvider logonProvider ) : System

Begins impersonation with the given credentials, Logon type and Logon provider.

비공개 메소드들

메소드 설명
UndoImpersonation ( ) : void

Stops impersonation.

메소드 상세

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
리턴 void

Impersonate() 공개 메소드

Impersonates the specified user account.
public Impersonate ( string userName, string domainName, string password ) : void
userName string Name of the user.
domainName string Name of the domain.
password string The password.
리턴 void

Impersonate() 공개 메소드

Impersonates the specified user account.
public Impersonate ( string userName, string domainName, string password, LogonType logonType, LogonProvider logonProvider ) : void
userName string Name of the user.
domainName string Name of the domain.
password string The password.
logonType LogonType Type of the logon.
logonProvider LogonProvider The logon provider.
리턴 void

Impersonator() 공개 메소드

Initializes a new instance of the Impersonator class.
public Impersonator ( ) : System
리턴 System

Impersonator() 공개 메소드

Begins impersonation with the given credentials.
public Impersonator ( string userName, string domainName, string password ) : System
userName string Name of the user.
domainName string Name of the domain.
password string The password.
리턴 System

Impersonator() 공개 메소드

Begins impersonation with the given credentials, Logon type and Logon provider.
public Impersonator ( string userName, string domainName, string password, LogonType logonType, LogonProvider logonProvider ) : System
userName string Name of the user.
domainName string Name of the domain.
password string The password.
logonType LogonType Type of the logon.
logonProvider LogonProvider The logon provider.
리턴 System