WindowsPrincipal(WindowsIdentity) Konstruktor

Definition

Initierar en ny instans av WindowsPrincipal klassen med hjälp av det angivna WindowsIdentity objektet.

public:
 WindowsPrincipal(System::Security::Principal::WindowsIdentity ^ ntIdentity);
public WindowsPrincipal(System.Security.Principal.WindowsIdentity ntIdentity);
new System.Security.Principal.WindowsPrincipal : System.Security.Principal.WindowsIdentity -> System.Security.Principal.WindowsPrincipal
Public Sub New (ntIdentity As WindowsIdentity)

Parametrar

ntIdentity
WindowsIdentity

Objektet som den nya instansen av ska konstrueras från WindowsPrincipal.

Undantag

ntIdentity är null.

Exempel

I följande exempel skapas ett nytt WindowsPrincipal objekt från det aktuella WindowsIdentity objektet.

WindowsIdentity^ wi = WindowsIdentity::GetCurrent();
WindowsPrincipal^ wp = gcnew WindowsPrincipal( wi );

WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);

Dim wi As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim wp As New WindowsPrincipal(wi)

Gäller för