Udostępnij za pośrednictwem


ProfileProvider.DeleteInactiveProfiles Metoda

Definicja

Po zastąpieniu klasy pochodnej usuwa wszystkie dane profilu użytkownika dla profilów, w których data ostatniego działania miała miejsce przed określoną datą.

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

Parametry

authenticationOption
ProfileAuthenticationOption

ProfileAuthenticationOption Jedna z wartości, określająca, czy są usuwane anonimowe, uwierzytelnione, czy oba typy profilów.

userInactiveSinceDate
DateTime

Element DateTime określający, które profile użytkowników są uznawane za nieaktywne. LastActivityDate Jeśli wartość profilu użytkownika przypada lub przed tą datą i godziną, profil jest uznawany za nieaktywny.

Zwraca

Liczba profilów usuniętych ze źródła danych.

Przykłady

Poniższy przykład kodu przedstawia podpis metody dla implementacji DeleteInactiveProfiles metody . Przykład pełnej ProfileProvider implementacji można znaleźć w temacie How to: Build and Run the Profile Provider Example (Instrukcje: kompilowanie i uruchamianie dostawcy profilu).

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

Uwagi

Metoda DeleteInactiveProfiles służy do usuwania nieużywanych danych profilu ze źródła danych. Usuwane są tylko dane określone applicationName w pliku konfiguracji. Parametr authenticationOption określa, czy przeszukiwane są tylko profile anonimowe, tylko profile uwierzytelnione, czy wszystkie profile. Profile, w których występuje wartość LastActivityDate lub przed usunięciem określonej userInactiveSinceDate wartości parametru.

Dotyczy

Zobacz też