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

包含数据源中所有配置文件的用户配置文件信息的 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参数标识要在 . ProfileInfoCollection中返回的最大对象数ProfileInfo。 该 pageIndex 参数标识要返回的结果页,其中零个标识第一页。 参数totalRecords是一个out参数,该参数根据参数userInactiveSinceDate设置为配置的applicationName``authenticationOption非活动用户配置文件总数。 例如,如果已配置 applicationName有 13 个用户,并且 pageIndex 值为 1 且 pageSize 值为 5,则 ProfileInfoCollection 返回的用户将包含返回的第六个到第十个非活动配置文件。 参数 totalRecords 将设置为 13。

适用于

另请参阅