MembershipProvider.FindUsersByName(String, Int32, Int32, Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得成員資格使用者的集合,其中的使用者名稱包含必須符合的特定使用者名稱。
public:
abstract System::Web::Security::MembershipUserCollection ^ FindUsersByName(System::String ^ usernameToMatch, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Security.MembershipUserCollection FindUsersByName (string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
abstract member FindUsersByName : string * int * int * int -> System.Web.Security.MembershipUserCollection
Public MustOverride Function FindUsersByName (usernameToMatch As String, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As MembershipUserCollection
參數
- usernameToMatch
- String
要搜尋的使用者名稱。
- pageIndex
- Int32
要傳回的結果頁面索引。 pageIndex
以零為起始。
- pageSize
- Int32
要傳回的結果網頁大小。
- totalRecords
- Int32
相符的使用者總數。
傳回
包含一頁 pageSize
MembershipUser 物件的 MembershipUserCollection 集合,從 pageIndex
指定的頁面開始。
範例
如需實作的 MembershipProvider 範例,請參閱 實作設定檔提供者。
備註
FindUsersByName會傳回成員資格使用者的清單,其中使用者名稱符合為所設定 ApplicationName 屬性提供的 usernameToMatch
。 如果您的資料來源支援其他搜尋功能,例如萬用字元,您可以提供更廣泛的使用者名稱搜尋功能。
傳 FindUsersByName 回的結果受限於 pageIndex
和 pageSize
參數。 參數 pageSize
會識別集合中 MembershipUserCollection 要傳回的物件 MembershipUser 數目。 參數 pageIndex
會識別要傳回的結果頁面,其中 0 會識別第一頁。 參數 totalRecords
是參數 out
,設定為符合 usernameToMatch
值的成員資格使用者總數。 例如,如果找到符合部分或整個使用者名稱的 13 位使用者 usernameToMatch
,且 pageIndex
值為 1 pageSize
且值為 5,則 MembershipUserCollection 會包含第六位到第十位傳回的使用者。 totalRecords
會設定為 13。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應