ProfileProvider.GetAllProfiles 方法

定义

在派生类中重写时,检索数据源中所有配置文件的用户配置文件数据。

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

参数

authenticationOption
ProfileAuthenticationOption

其中一个 ProfileAuthenticationOption 值,指定是返回匿名、经过身份验证还是两种类型的配置文件。

pageIndex
Int32

要返回的结果页的索引。

pageSize
Int32

要返回的结果页的大小。

totalRecords
Int32

此方法返回时,包含配置文件总数。

返回

ProfileInfoCollection包含数据源中所有配置文件的用户配置文件信息。

示例

下面的代码示例演示方法实现 GetAllProfiles 的方法签名。 有关完整 ProfileProvider 实现的示例,请参阅 “如何:生成和运行配置文件提供程序示例”。

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

注解

该方法 GetAllProfiles 用于检索所有配置文件的配置文件信息。 仅返回配置文件中指定的数据 applicationName 。 该 authenticationOption 参数指定是仅搜索匿名配置文件、仅经过身份验证的配置文件还是搜索所有配置文件。

返回 GetAllInactiveProfiles 的结果受 pageIndex 参数约束 pageSize 。 该pageSize参数标识在 . 中ProfileInfo返回的最大对象数ProfileInfoCollection。 该 pageIndex 参数标识要返回的结果页,其中零标识第一页。 参数totalRecords是一个out参数,根据配置的参数applicationName和参数设置为配置的authenticationOptionuserInactiveSinceDate非活动用户配置文件总数。 例如,如果配置 applicationName了 13 个用户,并且 pageIndex 值为 1 pageSize 且值为 5,则 ProfileInfoCollection 返回的用户将包含返回的第六个到第十个非活动配置文件。 参数 totalRecords 将设置为 13。

适用于

另请参阅