FormsAuthenticationUserCollection.Get 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得指定的 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)
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應