Freigeben über


WindowsPrincipal-Konstruktor

Initialisiert eine neue Instanz der WindowsPrincipal-Klasse mithilfe des angegebenen WindowsIdentity-Objekts.

Namespace: System.Security.Principal
Assembly: mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Sub New ( _
    ntIdentity As WindowsIdentity _
)
'Usage
Dim ntIdentity As WindowsIdentity

Dim instance As New WindowsPrincipal(ntIdentity)
public WindowsPrincipal (
    WindowsIdentity ntIdentity
)
public:
WindowsPrincipal (
    WindowsIdentity^ ntIdentity
)
public WindowsPrincipal (
    WindowsIdentity ntIdentity
)
public function WindowsPrincipal (
    ntIdentity : WindowsIdentity
)

Parameter

Ausnahmen

Ausnahmetyp Bedingung

ArgumentNullException

ntIdentity ist NULL (Nothing in Visual Basic).

Beispiel

Im folgenden Beispiel wird aus dem aktuellen WindowsIdentity-Objekt ein neues WindowsPrincipal-Objekt erstellt.

Dim wi As WindowsIdentity = WindowsIdentity.GetCurrent()
Dim wp As New WindowsPrincipal(wi)        
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);
WindowsIdentity^ wi = WindowsIdentity::GetCurrent();
WindowsPrincipal^ wp = gcnew WindowsPrincipal( wi );
WindowsIdentity wi = WindowsIdentity.GetCurrent();
WindowsPrincipal wp = new WindowsPrincipal(wi);

Plattformen

Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

WindowsPrincipal-Klasse
WindowsPrincipal-Member
System.Security.Principal-Namespace