Bagikan melalui


WindowsPrincipal(WindowsIdentity) Konstruktor

Definisi

Menginisialisasi instans WindowsPrincipal baru kelas dengan menggunakan objek yang ditentukan WindowsIdentity .

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)

Parameter

ntIdentity
WindowsIdentity

Objek tempat untuk membangun instans baru .WindowsPrincipal

Pengecualian

ntIdentityadalah null.

Contoh

Contoh berikut membuat objek baru WindowsPrincipal dari objek saat ini WindowsIdentity .

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)

Berlaku untuk