ProfileProvider.DeleteInactiveProfiles Methode

Definition

Löscht beim Überschreiben in einer abgeleiteten Klasse alle Benutzerprofildaten für Profile, bei denen das Datum der letzten Aktivität vor dem angegebenen Datum liegt.

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

Parameter

authenticationOption
ProfileAuthenticationOption

Einer der ProfileAuthenticationOption-Werte, der angibt, ob anonyme Profile, authentifizierte Profile oder beide Profilarten gelöscht werden.

userInactiveSinceDate
DateTime

Ein DateTime, der festlegt, welche Benutzerprofile als inaktiv betrachtet werden. Wenn der LastActivityDate-Wert eines Benutzerprofils an oder vor diesem Zeitpunkt (Datum und Uhrzeit) auftritt, gilt das Profil als inaktiv.

Gibt zurück

Die Anzahl der aus der Datenquelle gelöschten Profile.

Beispiele

Das folgende Codebeispiel zeigt die Methodensignatur für eine Implementierung der DeleteInactiveProfiles -Methode. Ein Beispiel für eine vollständige ProfileProvider Implementierung finden Sie unter Vorgehensweise: Erstellen und Ausführen des Profilanbieterbeispiels.

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

Hinweise

Die DeleteInactiveProfiles -Methode wird verwendet, um nicht verwendete Profildaten aus der Datenquelle zu entfernen. Es werden nur Daten für die applicationName in der Konfigurationsdatei angegebene entfernt. Der authenticationOption Parameter gibt an, ob nur anonyme Profile, nur authentifizierte Profile oder alle Profile durchsucht werden. Profile, in denen auf LastActivityDate oder vor dem Löschen des angegebenen userInactiveSinceDate Parameterwerts auftritt.

Gilt für:

Weitere Informationen