ProfileProvider.GetAllProfiles Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
När de åsidosättas i en härledd klass hämtar användarprofildata för alla profiler i datakällan.
public:
abstract System::Web::Profile::ProfileInfoCollection ^ GetAllProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllProfiles : System.Web.Profile.ProfileAuthenticationOption * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllProfiles (authenticationOption As ProfileAuthenticationOption, 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.
- 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 för alla profiler i datakällan.
Exempel
I följande kodexempel visas metodsignaturen för en implementering av GetAllProfiles 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 GetAllProfiles(
ProfileAuthenticationOption authenticationOption,
int pageIndex,
int pageSize,
out int totalRecords)
{
totalRecords = 0;
return new ProfileInfoCollection();
}
Public Overrides Function GetAllProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
ByRef totalRecords As Integer) As ProfileInfoCollection
totalRecords = 0
Return New ProfileInfoCollection()
End Function
Kommentarer
Metoden GetAllProfiles används för att hämta profilinformation för alla profiler. Endast data för angivna applicationName i konfigurationsfilen returneras. Parametern authenticationOption anger om endast anonyma profiler, endast autentiserade profiler eller alla profiler genomsöks.
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.