ProfileProvider.DeleteInactiveProfiles Metod

Definition

När de åsidosättas i en härledd klass tar bort alla användarprofildata för profiler där det senaste aktivitetsdatumet inträffade före det angivna datumet.

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

Parametrar

authenticationOption
ProfileAuthenticationOption

Ett av ProfileAuthenticationOption värdena, som anger om anonyma, autentiserade eller båda typerna av profiler tas bort.

userInactiveSinceDate
DateTime

En DateTime som identifierar vilka användarprofiler som anses vara inaktiva. Om värdet för LastActivityDate en användarprofil inträffar på eller före detta datum och tid anses profilen vara inaktiv.

Returer

Antalet profiler som tagits bort från datakällan.

Exempel

I följande kodexempel visas metodsignaturen för en implementering av DeleteInactiveProfiles metoden. Ett exempel på en fullständig ProfileProvider implementering finns i How to: Build and Run the Profile Provider Example (Så här skapar och kör du exemplet profilprovider).

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

Kommentarer

Metoden DeleteInactiveProfiles används för att ta bort oanvända profildata från datakällan. Endast data för angivna applicationName i konfigurationsfilen tas bort. Parametern authenticationOption anger om endast anonyma profiler, endast autentiserade profiler eller alla profiler genomsöks. Profiler där inträffar LastActivityDate på eller innan det angivna userInactiveSinceDate parametervärdet tas bort.

Gäller för

Se även