WindowsPrincipal(WindowsIdentity) Constructor

Definitie

Initialiseert een nieuw exemplaar van de WindowsPrincipal klasse met behulp van het opgegeven WindowsIdentity object.

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)

Parameters

ntIdentity
WindowsIdentity

Het object waaruit het nieuwe exemplaar van WindowsPrincipal.

Uitzonderingen

ntIdentity is null.

Voorbeelden

In het volgende voorbeeld wordt een nieuw WindowsPrincipal object gemaakt op basis van het huidige WindowsIdentity object.

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)

Van toepassing op