MembershipProvider.GetAllUsers(Int32, Int32, Int32) 方法

定義

取得資料頁面中資料來源所有使用者的集合。

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

參數

pageIndex
Int32

要傳回的結果網頁索引。 pageIndex 以零為起始。

pageSize
Int32

要傳回的結果網頁大小。

totalRecords
Int32

相符的使用者總數。

傳回

包含一頁 pageSizeMembershipUser 物件的 MembershipUserCollection 集合,從 pageIndex 指定的頁面開始。

範例

如需實作的 MembershipProvider 範例,請參閱 實作設定檔提供者

備註

GetAllUsers 會從已設定 ApplicationName 屬性的資料來源傳回所有使用者的清單。 使用者會依使用者名稱依字母順序傳回。

GetAllUsers 回的結果會受到 pageIndexpageSize 參數的限制。 參數 pageSize 會識別集合中 MembershipUserCollection 要傳回的物件數目 MembershipUser 。 參數 pageIndex 會識別要傳回的結果頁面,其中 0 會識別第一頁。 參數 totalRecords 是設定 out 為資料庫中成員資格使用者總數的參數。 例如,如果資料庫中有 13 位使用者,且 pageIndex 值為 1 pageSize 且值為 5,則 MembershipUserCollection 會包含傳回的第六個到第十個使用者。 totalRecords 會設定為 13。

適用於

另請參閱