ProfileProvider.GetAllProfiles 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當在衍生類別中覆寫時,會取得資料來源中所有設定檔的使用者設定檔資料。
public:
abstract System::Web::Profile::ProfileInfoCollection ^ GetAllProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllProfiles : System.Web.Profile.ProfileAuthenticationOption * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllProfiles (authenticationOption As ProfileAuthenticationOption, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection
參數
- authenticationOption
- ProfileAuthenticationOption
其中一個 ProfileAuthenticationOption 值,指定是回傳匿名、認證或兩種類型的檔案。
- pageIndex
- Int32
結果頁面的索引將返回。
- pageSize
- Int32
結果頁面的大小。
- totalRecords
- Int32
當此方法返回時,包含了總數的剖面。
傳回
ProfileInfoCollection A 包含資料來源中所有用戶設定檔的資訊。
範例
以下程式碼範例展示了該方法實作 GetAllProfiles 的方法簽名。 完整實作範例 ProfileProvider 請參見 「如何建置並執行設定檔提供者範例」。
public override ProfileInfoCollection GetAllProfiles(
ProfileAuthenticationOption authenticationOption,
int pageIndex,
int pageSize,
out int totalRecords)
{
totalRecords = 0;
return new ProfileInfoCollection();
}
Public Overrides Function GetAllProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
ByRef totalRecords As Integer) As ProfileInfoCollection
totalRecords = 0
Return New ProfileInfoCollection()
End Function
備註
此 GetAllProfiles 方法用於取得所有檔案的資訊。 只會回傳設定檔中指定的資料 applicationName 。 該 authenticationOption 參數指定搜尋是否僅匿名個人檔案、僅驗證過個人檔案,或全部個人檔案。
所 GetAllInactiveProfiles 回傳的結果受限 pageIndex 於 和 pageSize 參數。 參數pageSize識別應回傳ProfileInfo的最大物件數量ProfileInfoCollection。 參數 pageIndex 用來指示要回傳哪一頁結果,其中 0 代表第一頁。 參數totalRecords是一個out參數,根據 和 applicationName 參數設定為已設定authenticationOptionuserInactiveSinceDate的非活躍使用者設定檔總數。 例如,若配置 applicationName為 的 有 13 位使用者,且 pageIndex 值為 1,a pageSize 為 5,則回傳的 ProfileInfoCollection 將包含第六到第十個回傳的非活躍設定檔。
totalRecords參數會設為 13。