Share via


WindowsPrincipal(WindowsIdentity) Oluşturucu

Tanım

Belirtilen WindowsIdentity nesneyi kullanarak sınıfının yeni bir örneğini WindowsPrincipal başlatır.

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)

Parametreler

ntIdentity
WindowsIdentity

yeni örneğinin WindowsPrincipaloluşturulduğu nesne.

Özel durumlar

ntIdentity, null değeridir.

Örnekler

Aşağıdaki örnek, geçerli WindowsIdentity nesneden yeni WindowsPrincipal bir nesne oluşturur.

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)

Şunlara uygulanır