ProfileProvider.GetNumberOfInactiveProfiles 方法

定义

在派生类中重写后,此方法返回最后一次活动在指定日期或指定日期之前发生的配置文件的数目。

public:
 abstract int GetNumberOfInactiveProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
public abstract int GetNumberOfInactiveProfiles (System.Web.Profile.ProfileAuthenticationOption authenticationOption, DateTime userInactiveSinceDate);
abstract member GetNumberOfInactiveProfiles : System.Web.Profile.ProfileAuthenticationOption * DateTime -> int
Public MustOverride Function GetNumberOfInactiveProfiles (authenticationOption As ProfileAuthenticationOption, userInactiveSinceDate As DateTime) As Integer

参数

authenticationOption
ProfileAuthenticationOption

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

userInactiveSinceDate
DateTime

一个 DateTime,确定将哪些用户配置文件视为处于不活动状态。 如果用户配置文件的 LastActivityDate 与此日期和时间相同,或在此日期和时间之前,则此配置文件被视为处于不活动状态。

返回

Int32

最后一次活动在指定日期或指定日期之前发生的配置文件的数目。

示例

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

public override int GetNumberOfInactiveProfiles(
    ProfileAuthenticationOption authenticationOption,
    DateTime userInactiveSinceDate)
{
    return 0;
}
Public Overrides Function GetNumberOfInactiveProfiles( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal userInactiveSinceDate As DateTime) As Integer

  Return 0
End Function

注解

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

适用于

另请参阅