Share via


FormsAuthenticationUserCollection.Get 方法

定義

取得指定的 FormsAuthenticationUser 集合項目。

多載

Get(String)

取得具有指定名稱的 FormsAuthenticationUser 集合項目。

Get(Int32)

取得位於指定索引的 FormsAuthenticationUser 集合項目。

Get(String)

取得具有指定名稱的 FormsAuthenticationUser 集合項目。

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

參數

name
String

使用者的名稱。

傳回

包含使用者名稱和密碼的 FormsAuthenticationUser 物件。

範例

下列程式碼範例示範如何存取具有指定名稱之使用者的認證。

// 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")

適用於

Get(Int32)

取得位於指定索引的 FormsAuthenticationUser 集合項目。

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

參數

index
Int32

集合使用者的索引。

傳回

包含使用者名稱和密碼的 FormsAuthenticationUser

範例

下列程式碼範例示範如何在指定的索引上存取使用者的認證。

// 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)

適用於