Szerkesztés

Megosztás a következőn keresztül:


MembershipProvider.GetAllUsers(Int32, Int32, Int32) Method

Definition

Gets a collection of all the users in the data source in pages of data.

public:
 abstract System::Web::Security::MembershipUserCollection ^ GetAllUsers(int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Security.MembershipUserCollection GetAllUsers (int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllUsers : int * int * int -> System.Web.Security.MembershipUserCollection
Public MustOverride Function GetAllUsers (pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As MembershipUserCollection

Parameters

pageIndex
Int32

The index of the page of results to return. pageIndex is zero-based.

pageSize
Int32

The size of the page of results to return.

totalRecords
Int32

The total number of matched users.

Returns

A MembershipUserCollection collection that contains a page of pageSizeMembershipUser objects beginning at the page specified by pageIndex.

Examples

For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

Remarks

GetAllUsers returns a list of all of the users from the data source for the configured ApplicationName property. Users are returned in alphabetical order by user name.

The results returned by GetAllUsers are constrained by the pageIndex and pageSize parameters. The pageSize parameter identifies the number of MembershipUser objects to return in the MembershipUserCollection collection. The pageIndex parameter identifies which page of results to return, where 0 identifies the first page. The totalRecords parameter is an out parameter that is set to the total number of membership users in the database. For example, if there are 13 users in the database, and the pageIndex value was 1 with a pageSize of 5, then the MembershipUserCollection would contain the sixth through the tenth users returned. totalRecords would be set to 13.

Applies to

See also