MembershipProvider.FindUsersByEmail(String, Int32, Int32, Int32) 方法

定义

获取成员资格用户集合,这些用户的电子邮件地址包含要匹配的指定电子邮件地址。Gets a collection of membership users where the email address contains the specified email address to match.

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

参数

emailToMatch
String

要搜索的电子邮件地址。The email address to search for.

pageIndex
Int32

要返回的结果页的索引。The index of the page of results to return. pageIndex 从零开始。pageIndex is zero-based.

pageSize
Int32

要返回的结果页的大小。The size of the page of results to return.

totalRecords
Int32

匹配用户的总数。The total number of matched users.

返回

包含一页 pageSizeMembershipUser 对象的 MembershipUserCollection 集合,这些对象从 pageIndex 指定的页开始。A MembershipUserCollection collection that contains a page of pageSizeMembershipUser objects beginning at the page specified by pageIndex.

示例

有关MembershipProvider实现的示例,请参阅实现配置文件提供程序For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

注解

FindUsersByEmail返回一个成员资格用户列表,其中用户的电子邮件地址与为emailToMatch配置ApplicationName的属性提供的匹配。FindUsersByEmail returns a list of membership users where the user's email address matches the supplied emailToMatch for the configured ApplicationName property. 如果数据源支持其他搜索功能(如通配符),则可以为电子邮件地址提供更广泛的搜索功能。If your data source supports additional search capabilities, such as wildcard characters, you can provide more extensive search capabilities for email addresses.

返回FindUsersByEmail的结果是pageIndex由和pageSize参数约束的。The results returned by FindUsersByEmail are constrained by the pageIndex and pageSize parameters. 参数标识要在MembershipUserCollection集合中MembershipUser返回的对象的数目。 pageSizeThe pageSize parameter identifies the number of MembershipUser objects to return in the MembershipUserCollection collection. pageIndex参数标识返回的结果页,其中0标识第一页。The pageIndex parameter identifies which page of results to return where 0 identifies the first page. 参数是设置为与emailToMatch值匹配的成员资格用户总数的参数。out totalRecordsThe totalRecords parameter is an out parameter that is set to the total number of membership users that matched the emailToMatch value. 例如,如果找到13个用户(其中emailToMatch匹配部分或整个电子邮件地址), pageIndex并且pageSize值为1且为5, MembershipUserCollection则将包含返回的第6个到第10个用户。For example, if 13 users were found where emailToMatch matched part of or the entire email address, and the pageIndex value was 1 with a pageSize of 5, then the MembershipUserCollection would contain the sixth through the tenth users returned. totalRecords将设置为13。totalRecords would be set to 13.

适用于

另请参阅