System.Web.Profile.ProfileManager.FindInactiveProfilesByUserName Method

Retrieves profile information for all profiles in which the last activity date occurred on or before the specified date and time and the user name for the profile matches the specified name.

Syntax

public static ProfileInfoCollection FindInactiveProfilesByUserName (ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate)

Parameters

authenticationOption
One of the System.Web.Profile.ProfileAuthenticationOption enumeration values, specifying whether anonymous, authenticated, or both types of profiles are returned.
usernameToMatch
The user name for which to search.
userInactiveSinceDate
A DateTime that identifies which user profiles are considered inactive. If the ProfileInfo.LastActivityDate of a user profile occurs on or before this date and time, the profile is considered inactive.

Returns

A System.Web.Profile.ProfileInfoCollection containing user profile information for inactive profiles in which the user name matches the supplied usernameToMatch parameter.

Remarks

The ProfileManager.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime) method is used to retrieve profile information for all unused user profiles for the application specified by the applicationName attribute in the configuration file. This method will only retrieve profiles for which the profile user name matches the supplied usernameToMatch parameter value. Use the authenticationOption parameter to specify whether you want only anonymous profiles, only authenticated profiles, or all profiles to be searched. Of the searched profiles, any profile with a ProfileInfo.LastActivityDate that occurs on or before the specified userInactiveSinceDate parameter value is returned.

You can retrieve this information in pages of data using the overload for the ProfileManager.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime, int, int, Int32@) method that takes additional pageIndex and pageSize parameters.

Note:

Your profile provider may support wildcard characters in the usernameToMatch parameter. For example, the SqlProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime, int, int, Int32@) method of the System.Web.Profile.SqlProfileProvider class supports wildcard characters in the usernameToMatch parameter.

The ProfileManager.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime) method calls the ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime, int, int, Int32@) method of the default profile provider. The default profile provider is specified using the defaultProvider attribute of the profile configuration element. If the user profile contains properties that are managed by a profile provider other than the default provider, the data source for the other profile provider is not searched. To find inactive profiles that are managed by a profile provider other than the default provider, obtain a reference to the profile provider using the ProfileManager.Providers property and call the ProfileProvider.FindInactiveProfilesByUserName(ProfileAuthenticationOption, string, DateTime, int, int, Int32@) method of the provider directly.

Requirements

Namespace: System.Web.Profile
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0