Język

GenericIdentity Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy GenericIdentity.

Przeciążenia

Nazwa Opis
GenericIdentity(GenericIdentity)

Inicjuje nowe wystąpienie GenericIdentity klasy przy użyciu określonego GenericIdentity obiektu.

GenericIdentity(String)

Inicjuje nowe wystąpienie GenericIdentity klasy reprezentującej użytkownika o określonej nazwie.

GenericIdentity(String, String)

Inicjuje nowe wystąpienie GenericIdentity klasy reprezentującej użytkownika o określonej nazwie i typie uwierzytelniania.

GenericIdentity(GenericIdentity)

Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs

Inicjuje nowe wystąpienie GenericIdentity klasy przy użyciu określonego GenericIdentity obiektu.

protected:
 GenericIdentity(System::Security::Principal::GenericIdentity ^ identity);
protected GenericIdentity(System.Security.Principal.GenericIdentity identity);
new System.Security.Principal.GenericIdentity : System.Security.Principal.GenericIdentity -> System.Security.Principal.GenericIdentity
Protected Sub New (identity As GenericIdentity)

Parametry

identity
GenericIdentity

Obiekt, z którego ma utworzyć nowe wystąpienie klasy GenericIdentity.

Dotyczy

GenericIdentity(String)

Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs

Inicjuje nowe wystąpienie GenericIdentity klasy reprezentującej użytkownika o określonej nazwie.

public:
 GenericIdentity(System::String ^ name);
public GenericIdentity(string name);
new System.Security.Principal.GenericIdentity : string -> System.Security.Principal.GenericIdentity
Public Sub New (name As String)

Parametry

name
String

Nazwa użytkownika, którego imieniu kod jest uruchomiony.

Wyjątki

Parametr name jest null.

Przykłady

Poniższy kod przedstawia użycie konstruktora GenericIdentity . Ten przykład kodu jest częścią większego przykładu udostępnionego dla klasy GenericIdentity.

GenericIdentity^ defaultIdentity = gcnew GenericIdentity( "DefaultUser" );
GenericIdentity defaultIdentity = new GenericIdentity("DefaultUser");
Dim defaultIdentity As New GenericIdentity("DefaultUser")

Dotyczy

GenericIdentity(String, String)

Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs
Źródło:
GenericIdentity.cs

Inicjuje nowe wystąpienie GenericIdentity klasy reprezentującej użytkownika o określonej nazwie i typie uwierzytelniania.

public:
 GenericIdentity(System::String ^ name, System::String ^ type);
public GenericIdentity(string name, string type);
new System.Security.Principal.GenericIdentity : string * string -> System.Security.Principal.GenericIdentity
Public Sub New (name As String, type As String)

Parametry

name
String

Nazwa użytkownika, którego imieniu kod jest uruchomiony.

type
String

Typ uwierzytelniania używany do identyfikowania użytkownika.

Wyjątki

Parametr name jest null.

— lub —

Parametr type jest null.

Przykłady

Poniższy kod przedstawia użycie konstruktora GenericIdentity . Ten przykład kodu jest częścią większego przykładu udostępnionego dla klasy GenericIdentity.

WindowsIdentity^ windowsIdentity = WindowsIdentity::GetCurrent();

// Construct a GenericIdentity object based on the current Windows
// identity name and authentication type.
String^ authenticationType = windowsIdentity->AuthenticationType;
String^ userName = windowsIdentity->Name;
GenericIdentity^ authenticatedGenericIdentity = gcnew GenericIdentity( userName,authenticationType );
WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent();

// Construct a GenericIdentity object based on the current Windows
// identity name and authentication type.
string authenticationType = windowsIdentity.AuthenticationType;
string userName = windowsIdentity.Name;
GenericIdentity authenticatedGenericIdentity =
    new GenericIdentity(userName, authenticationType);
Dim windowsIdentity As WindowsIdentity = windowsIdentity.GetCurrent()

' Construct a GenericIdentity object based on the current Windows
' identity name and authentication type.
Dim authenticationType As String = windowsIdentity.AuthenticationType
Dim userName As String = windowsIdentity.Name
Dim authenticatedGenericIdentity As _
    New GenericIdentity(userName, authenticationType)

Dotyczy