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

TokenImpersonationLevel

Jedna z wartości wyliczenia, która określa poziom personifikacji.

Atrybuty

Przykłady

Poniższy przykład kodu przedstawia użycie właściwości do wyświetlania poziomu ImpersonationLevel personifikacji dla bieżącego użytkownika. Ten przykład kodu jest częścią większego przykładu dostarczonego dla WindowsIdentity 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 WMI.

Dotyczy