語言

ProfileProvider.GetNumberOfInactiveProfiles 方法

定義

當在派生類別中覆寫時,會回傳最後活動日期發生在指定日期或之前的檔案數量。

public:
 abstract int GetNumberOfInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
public abstract int GetNumberOfInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
abstract member GetNumberOfInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime -> int
Public MustOverride Function GetNumberOfInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime) As Integer

參數

authenticationOption
ProfileAuthenticationOption

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

userInactiveSinceDate
DateTime

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

傳回

指最後活動日期發生在指定日期或之前的檔案數量。

範例

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

public override int GetNumberOfInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate)
{
    return 0;
}
Public Overrides Function GetNumberOfInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime) As Integer

  Return 0
End Function

備註

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

適用於

另請參閱