FormsAuthenticationUserCollection.Get Metoda

Definicja

Pobiera określony FormsAuthenticationUser element kolekcji.

Przeciążenia

Get(String)

Pobiera element kolekcji FormsAuthenticationUser o określonej nazwie.

Get(Int32)

Pobiera element kolekcji FormsAuthenticationUser w określonym indeksie.

Get(String)

Pobiera element kolekcji FormsAuthenticationUser o określonej nazwie.

public:
 System::Web::Configuration::FormsAuthenticationUser ^ Get(System::String ^ name);
public System.Web.Configuration.FormsAuthenticationUser Get (string name);
member this.Get : string -> System.Web.Configuration.FormsAuthenticationUser
Public Function Get (name As String) As FormsAuthenticationUser

Parametry

name
String

Nazwa użytkownika.

Zwraca

FormsAuthenticationUser Obiekt zawierający nazwę użytkownika i hasło.

Przykłady

W poniższym przykładzie kodu pokazano, jak uzyskać dostęp do poświadczeń użytkownika o określonej nazwie.

// Get the user with the specified name.
FormsAuthenticationUser storedUser = 
    formsAuthenticationCredentials.Users.Get("userName");
' Get the user with the specified name.
  Dim storedUser As FormsAuthenticationUser = _
  formsAuthenticationCredentials.Users.Get("userName")

Dotyczy

Get(Int32)

Pobiera element kolekcji FormsAuthenticationUser w określonym indeksie.

public:
 System::Web::Configuration::FormsAuthenticationUser ^ Get(int index);
public System.Web.Configuration.FormsAuthenticationUser Get (int index);
member this.Get : int -> System.Web.Configuration.FormsAuthenticationUser
Public Function Get (index As Integer) As FormsAuthenticationUser

Parametry

index
Int32

Indeks użytkownika kolekcji.

Zwraca

Element FormsAuthenticationUser zawierający nazwę użytkownika i hasło.

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać dostęp do poświadczeń użytkownika w określonym indeksie.

// Get the user at the specified index.
FormsAuthenticationUser storedUser2 = 
    formsAuthenticationCredentials.Users.Get(0);
' Get the user at the specified index.
  Dim storedUser2 As FormsAuthenticationUser = _
  formsAuthenticationCredentials.Users.Get(0)

Dotyczy