Share via


WindowsPrincipal(WindowsIdentity) Konstruktor

Definice

Inicializuje novou instanci WindowsPrincipal třídy pomocí zadaného WindowsIdentity objektu.

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)

Parametry

ntIdentity
WindowsIdentity

Objekt, ze kterého se má vytvořit nová instance objektu WindowsPrincipal.

Výjimky

ntIdentity je null.

Příklady

Následující příklad vytvoří nový WindowsPrincipal objekt z aktuálního WindowsIdentity objektu.

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)

Platí pro