WindowsIdentity.ImpersonationLevel Egenskap

Definition

Hämtar personifieringsnivån för användaren.

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

Egenskapsvärde

Ett av uppräkningsvärdena som anger personifieringsnivån.

Attribut

Exempel

I följande kodexempel visas användningen av ImpersonationLevel egenskapen för att visa personifieringsnivån för den aktuella användaren. Det här kodexemplet är en del av ett större exempel för WindowsIdentity klassen.

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())

Kommentarer

Beskriver personifieringsnivån som ska användas för att ansluta till WMI.

Gäller för