WindowsPrincipal(WindowsIdentity) Конструктор

Определение

Инициализирует новый экземпляр класса WindowsPrincipal, используя указанный объект 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)

Параметры

ntIdentity
WindowsIdentity

Объект, из которого создается новый экземпляр WindowsPrincipal.

Исключения

ntIdentity имеет значение null.

Примеры

В следующем примере создается новый WindowsPrincipal объект из текущего 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)

Применяется к