ProfileProvider.GetAllInactiveProfiles 方法

定义

在派生类中重写时,从数据源中检索在其中发生上次活动日期或指定日期之前的配置文件的用户配置文件数据。

public:
 abstract System::Web::Profile::ProfileInfoCollection ^ GetAllInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, [Runtime::InteropServices::Out] int % totalRecords);
public abstract System.Web.Profile.ProfileInfoCollection GetAllInactiveProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords);
abstract member GetAllInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime * int * int * int -> System.Web.Profile.ProfileInfoCollection
Public MustOverride Function GetAllInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime, pageIndex As Integer, pageSize As Integer, ByRef totalRecords As Integer) As ProfileInfoCollection

参数

authenticationOption
ProfileAuthenticationOption

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

userInactiveSinceDate
DateTime

标识 DateTime 哪些用户配置文件被视为非活动状态。 LastActivityDate如果用户配置文件在此日期和时间之前发生,则配置文件被视为处于非活动状态。

pageIndex
Int32

要返回的结果页的索引。

pageSize
Int32

要返回的结果页的大小。

totalRecords
Int32

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

返回

包含 ProfileInfoCollection 有关非活动配置文件的用户配置文件信息。

示例

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

public override ProfileInfoCollection GetAllInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate,
    int pageIndex,
    int pageSize,
    out int totalRecords)
{
    totalRecords = 0;

    return new ProfileInfoCollection();
}
Public Overrides Function GetAllInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime, _
ByVal pageIndex As Integer, _
ByVal pageSize As Integer, _
 ByRef totalRecords As Integer) As ProfileInfoCollection

  totalRecords = 0

  Return New ProfileInfoCollection()
End Function

注解

该方法 GetAllInactiveProfiles 用于检索未使用的用户配置文件的配置文件信息。 仅返回配置文件中指定的数据 applicationName 。 该 authenticationOption 参数指定是仅搜索匿名配置文件、仅经过身份验证的配置文件还是搜索所有配置文件。 在搜索的配置文件中,返回 LastActivityDate 指定 userInactiveSinceDate 参数值之前或之前发生的任何配置文件。

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

适用于

另请参阅