ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, String, DateTime, Int32, Int32, Int32) ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, String, DateTime, Int32, Int32, Int32) ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, String, DateTime, Int32, Int32, Int32) ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, String, DateTime, Int32, Int32, Int32) Method

定义

在派生类中重写后,此方法检索最后一次活动在指定日期或指定日期之前发生并且用户名与指定用户名相匹配的配置文件的配置文件信息。When overridden in a derived class, retrieves profile information for profiles in which the last activity date occurred on or before the specified date and the user name matches the specified user name.

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

参数

authenticationOption
ProfileAuthenticationOption ProfileAuthenticationOption ProfileAuthenticationOption ProfileAuthenticationOption

ProfileAuthenticationOption 值之一,指定是返回匿名配置文件、经过身份验证的配置文件还是同时返回这两种类型的配置文件。One of the ProfileAuthenticationOption values, specifying whether anonymous, authenticated, or both types of profiles are returned.

usernameToMatch
String String String String

要搜索的用户名。The user name to search for.

userInactiveSinceDate
DateTime DateTime DateTime DateTime

一个 DateTime,确定将哪些用户配置文件视为处于不活动状态。A DateTime that identifies which user profiles are considered inactive. 如果用户配置文件的 LastActivityDate 值与此日期和时间相同,或在此日期和时间之前,则此配置文件被视为处于不活动状态。If the LastActivityDate value of a user profile occurs on or before this date and time, the profile is considered inactive.

pageIndex
Int32 Int32 Int32 Int32

要返回的结果页的索引。The index of the page of results to return.

pageSize
Int32 Int32 Int32 Int32

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

totalRecords
Int32 Int32 Int32 Int32

当此方法返回时,此参数包含配置文件的总数。When this method returns, contains the total number of profiles.

返回

包含不活动配置文件的用户配置文件信息的 ProfileInfoCollection,这些不活动配置文件中的用户名与提供的 usernameToMatch 参数相匹配。A ProfileInfoCollection containing user profile information for inactive profiles where the user name matches the supplied usernameToMatch parameter.

示例

下面的代码示例演示FindInactiveProfilesByUserName方法的实现的方法签名。The following code example shows the method signature for an implementation of the FindInactiveProfilesByUserName method. 有关完整ProfileProvider实现的示例,请参阅如何:生成并运行配置文件提供程序示例。For an example of a full ProfileProvider implementation, see How to: Build and Run the Profile Provider Example.

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

    return new ProfileInfoCollection();
}
Public Overrides Function FindInactiveProfilesByUserName( _
ByVal authenticationOption As ProfileAuthenticationOption, _
ByVal usernameToMatch As String, _
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

注解

方法用于检索用户名称与提供usernameToMatch的参数匹配的配置文件的未使用用户配置文件的配置文件信息。 FindInactiveProfilesByUserNameThe FindInactiveProfilesByUserName method is used to retrieve profile information for unused user profiles for profiles in which the user name matches the supplied usernameToMatch parameter. 仅返回配置文件applicationName中指定的数据。Only data for the applicationName specified in the configuration file is returned. authenticationOption参数指定是否仅搜索匿名配置文件、是否仅搜索已通过身份验证的配置文件或所有配置文件。The authenticationOption parameter specifies whether only anonymous profiles, only authenticated profiles, or all profiles are searched. 在搜索配置文件中,将返回任何LastActivityDate配置文件,该配置文件在userInactiveSinceDate指定的参数值上或之前发生。Of the searched profiles, any profile with a LastActivityDate that occurs on or before the specified userInactiveSinceDate parameter value is returned.

如果数据源支持其他搜索功能(如通配符),则可以为用户名提供更广泛的搜索功能。If your data source supports additional search capabilities, such as wildcard characters, you can provide more extensive search capabilities for user names.

返回FindInactiveProfilesByUserName的结果是pageIndex由和pageSize参数约束的。The results returned by FindInactiveProfilesByUserName are constrained by the pageIndex and pageSize parameters. 参数标识要在中返回的ProfileInfo ProfileInfoCollection对象的最大数目。 pageSizeThe pageSize parameter identifies the maximum number of ProfileInfo objects to return in the ProfileInfoCollection. pageIndex参数标识要返回的结果页,其中零标识第一页。The pageIndex parameter identifies which page of results to return, where zero identifies the first page. out applicationName authenticationOption参数是一个参数,该参数设置为基于和userInactiveSinceDate参数配置的非活动用户配置文件的总数。 totalRecordsThe totalRecords parameter is an out parameter that is set to the total number of inactive user profiles for the configured applicationName, based on the authenticationOption and userInactiveSinceDate parameters. applicationName例如,如果配置的有13个用户, pageIndex并且pageSize值为1且为5,则ProfileInfoCollection返回的将包含返回的第六个非活动配置文件。For example, if there are 13 users for the configured applicationName, and the pageIndex value is 1 with a pageSize of 5, the ProfileInfoCollection returned would contain the sixth through the tenth inactive profiles returned. totalRecords参数将设置为13。The totalRecords parameter would be set to 13.

适用于

另请参阅