語言

ProfileProvider.GetAllInactiveProfiles 方法

定義

當在衍生類別中覆寫時,會從資料來源中取得最後活動日期發生在指定日期或之前的使用者設定檔資料。

public:
 abstract System::Web::Profile::ProfileInfoCollection ^ GetAllInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection

參數

authenticationOption
ProfileAuthenticationOption

其中一個 ProfileAuthenticationOption 值,指定是回傳匿名、認證或兩種類型的檔案。

userInactiveSinceDate
DateTime

DateTime A是用來標示哪些使用者設定檔被視為非活躍的。 若 LastActivityDate 用戶個人檔案在此日期及時間或之前出現,該個人檔案將被視為非活躍。

pageIndex
Int32

結果頁面的索引將返回。

pageSize
Int32

結果頁面的大小。

totalRecords
Int32

當此方法返回時,包含了總數的剖面。

傳回

ProfileInfoCollection A 包含關於非活躍用戶檔案的使用者個人檔案資訊。

範例

以下程式碼範例展示了該方法實作 GetAllInactiveProfiles 的方法簽名。 完整實作範例 ProfileProvider 請參見 「如何建置並執行設定檔提供者範例」。

public override ProfileInfoCollection GetAllInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate,
    int pageIndex,
    int pageSize,
    out int totalRecords)
{
    totalRecords = 0;

    return new ProfileInfoCollection();
}
Public Overrides Function GetAllInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
 ByRef totalRecords As Integer) As ProfileInfoCollection

  totalRecords = 0

  Return New ProfileInfoCollection()
End Function

備註

此 GetAllInactiveProfiles 方法用於取得未使用的使用者設定檔資訊。 只會回傳設定檔中指定的資料 applicationName 。 該 authenticationOption 參數指定搜尋是否僅匿名個人檔案、僅驗證過個人檔案,或全部個人檔案。 在搜尋的設定檔中,任何出現在指定LastActivityDate參數值或之前的 a userInactiveSinceDate 設定檔都會回傳。

所 GetAllInactiveProfiles 回傳的結果受限 pageIndex 於 和 pageSize 參數。 參數pageSize識別應回傳ProfileInfo的最大物件數量ProfileInfoCollection。 參數 pageIndex 用來指示要回傳哪一頁結果,其中 0 代表第一頁。 參數totalRecords是一個out參數,根據 和 applicationName 參數設定為已設定authenticationOptionuserInactiveSinceDate的非活躍使用者設定檔總數。 例如,若配置 applicationName為 的 有 13 位使用者,且 pageIndex 值為 1,a pageSize 為 5,則回傳的 ProfileInfoCollection 將包含第六到第十個回傳的非活躍設定檔。 totalRecords參數會設為 13。

適用於

另請參閱