ProfileProvider.GetAllInactiveProfiles Metod

Definition

När de åsidosätts i en härledd klass hämtar de användarprofildata från datakällan för profiler där det senaste aktivitetsdatumet inträffade på eller före det angivna datumet.

public:
 abstract System::Web::Profile::ProfileInfoCollection ^ GetAllInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection

Parametrar

authenticationOption
ProfileAuthenticationOption

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

userInactiveSinceDate
DateTime

En DateTime som identifierar vilka användarprofiler som anses vara inaktiva. Om användarprofilen LastActivityDate förekommer på eller före detta datum och tid anses profilen vara inaktiv.

pageIndex
Int32

Indexet för den resultatsida som ska returneras.

pageSize
Int32

Storleken på sidan med resultat som ska returneras.

totalRecords
Int32

När den här metoden returneras innehåller det totala antalet profiler.

Returer

En ProfileInfoCollection som innehåller användarprofilinformation om de inaktiva profilerna.

Exempel

I följande kodexempel visas metodsignaturen för en implementering av GetAllInactiveProfiles 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 ProfileInfoCollection GetAllInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate,
    int pageIndex,
    int pageSize,
    out int totalRecords)
{
    totalRecords = 0;

    return new ProfileInfoCollection();
}
Public Overrides Function GetAllInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
 ByRef totalRecords As Integer) As ProfileInfoCollection

  totalRecords = 0

  Return New ProfileInfoCollection()
End Function

Kommentarer

Metoden GetAllInactiveProfiles används för att hämta profilinformation för oanvända användarprofiler. Endast data för angivna applicationName i konfigurationsfilen returneras. Parametern authenticationOption anger om endast anonyma profiler, endast autentiserade profiler eller alla profiler genomsöks. Av de sökta profilerna returneras alla profiler med en LastActivityDate som inträffar på eller innan det angivna userInactiveSinceDate parametervärdet.

Resultaten som returneras av GetAllInactiveProfiles begränsas av parametrarna pageIndex och pageSize . Parametern pageSize identifierar det maximala antalet ProfileInfo objekt som ska returneras ProfileInfoCollectioni . Parametern pageIndex identifierar vilken sida med resultat som ska returneras, där noll identifierar den första sidan. Parametern totalRecords är en out parameter som är inställd på det totala antalet inaktiva användarprofiler för den konfigurerade applicationName, baserat på parametrarna authenticationOption och userInactiveSinceDate . Om det till exempel finns 13 användare för den konfigurerade applicationName, och pageIndex värdet är 1 med värdet pageSize 5, skulle den ProfileInfoCollection returnerade innehålla den sjätte till den tionde inaktiva profilen som returneras. Parametern totalRecords skulle vara inställd på 13.

Gäller för

Se även