Udostępnij przez


WindowsIdentity.ImpersonationLevel Właściwość

Definicja

Pobiera poziom personifikacji dla użytkownika.

public:
 property System::Security::Principal::TokenImpersonationLevel ImpersonationLevel { System::Security::Principal::TokenImpersonationLevel get(); };
public System.Security.Principal.TokenImpersonationLevel ImpersonationLevel { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public System.Security.Principal.TokenImpersonationLevel ImpersonationLevel { get; }
member this.ImpersonationLevel : System.Security.Principal.TokenImpersonationLevel
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.ImpersonationLevel : System.Security.Principal.TokenImpersonationLevel
Public ReadOnly Property ImpersonationLevel As TokenImpersonationLevel

Wartość właściwości

Jedna z wartości wyliczenia określająca poziom personifikacji.

Atrybuty

Przykłady

Poniższy przykład kodu przedstawia użycie ImpersonationLevel właściwości w celu wyświetlenia poziomu personifikacji dla bieżącego użytkownika. Ten przykład kodu jest częścią większego przykładu udostępnionego WindowsIdentity dla klasy .

TokenImpersonationLevel token = windowsIdentity.ImpersonationLevel;
Console.WriteLine("The impersonation level for the current user is : " + token.ToString());
Dim token As TokenImpersonationLevel
token = windowsIdentity.ImpersonationLevel
Console.WriteLine("The impersonation level for the current user is : " + token.ToString())

Uwagi

Opisuje poziom personifikacji, który ma być używany do nawiązywania połączenia z usługą WMI.

Dotyczy