語言

ProfileProvider.DeleteInactiveProfiles 方法

定義

當在派生類別中覆寫時,會刪除所有最後活動日期在指定日期之前的使用者設定檔資料。

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

參數

authenticationOption
ProfileAuthenticationOption

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

userInactiveSinceDate
DateTime

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

傳回

從資料來源中刪除的個人資料數量。

範例

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

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

  Return 0
End Function

備註

此 DeleteInactiveProfiles 方法用於從資料來源中移除未使用的輪廓資料。 只有設定檔中指定的資料 applicationName 會被移除。 該 authenticationOption 參數指定搜尋是否僅匿名個人檔案、僅驗證過個人檔案,或全部個人檔案。 在指定LastActivityDate參數值之前出現 的userInactiveSinceDate設定檔會被刪除。

適用於

另請參閱