MembershipProvider.GetUser 方法

定义

从数据源获取成员资格用户的信息。Gets information from the data source for a membership user.

重载

GetUser(String, Boolean)

从数据源获取用户的信息。Gets information from the data source for a user. 提供一个更新用户最近一次活动的日期/时间戳的选项。Provides an option to update the last-activity date/time stamp for the user.

GetUser(Object, Boolean)

根据成员资格用户的唯一标识符从数据源获取用户信息。Gets user information from the data source based on the unique identifier for the membership user. 提供一个更新用户最近一次活动的日期/时间戳的选项。Provides an option to update the last-activity date/time stamp for the user.

GetUser(String, Boolean)

从数据源获取用户的信息。Gets information from the data source for a user. 提供一个更新用户最近一次活动的日期/时间戳的选项。Provides an option to update the last-activity date/time stamp for the user.

public:
 abstract System::Web::Security::MembershipUser ^ GetUser(System::String ^ username, bool userIsOnline);
public abstract System.Web.Security.MembershipUser GetUser (string username, bool userIsOnline);
abstract member GetUser : string * bool -> System.Web.Security.MembershipUser
Public MustOverride Function GetUser (username As String, userIsOnline As Boolean) As MembershipUser

参数

username
String

要获取其信息的用户名。The name of the user to get information for.

userIsOnline
Boolean

如果为 true,则更新用户最近一次活动的日期/时间戳;如果为 false,则返回用户信息,但不更新用户最近一次活动的日期/时间戳。true to update the last-activity date/time stamp for the user; false to return user information without updating the last-activity date/time stamp for the user.

返回

用数据源中指定用户的信息填充的 MembershipUser 对象。A MembershipUser object populated with the specified user's information from the data source.

示例

有关MembershipProvider实现的示例,请参阅实现配置文件提供程序For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

注解

采用作为输入的用户名和一个布尔值,该值指示是否更新LastActivityDate用户的属性值以显示用户当前是否处于联机状态。Takes, as input, a user name and a Boolean value indicating whether to update the LastActivityDate property value for the user to show that the user is currently online. GetUser返回使用MembershipUser指定用户的数据源中的当前值填充的对象。GetUser returns a MembershipUser object populated with current values from the data source for the specified user. 如果在数据源中找不到该用户名, GetUser则返回。 nullIf the user name is not found in the data source, GetUser returns null.

另请参阅

GetUser(Object, Boolean)

根据成员资格用户的唯一标识符从数据源获取用户信息。Gets user information from the data source based on the unique identifier for the membership user. 提供一个更新用户最近一次活动的日期/时间戳的选项。Provides an option to update the last-activity date/time stamp for the user.

public:
 abstract System::Web::Security::MembershipUser ^ GetUser(System::Object ^ providerUserKey, bool userIsOnline);
public abstract System.Web.Security.MembershipUser GetUser (object providerUserKey, bool userIsOnline);
abstract member GetUser : obj * bool -> System.Web.Security.MembershipUser
Public MustOverride Function GetUser (providerUserKey As Object, userIsOnline As Boolean) As MembershipUser

参数

providerUserKey
Object

要获取其信息的成员资格用户的唯一标识符。The unique identifier for the membership user to get information for.

userIsOnline
Boolean

如果为 true,则更新用户最近一次活动的日期/时间戳;如果为 false,则返回用户信息,但不更新用户最近一次活动的日期/时间戳。true to update the last-activity date/time stamp for the user; false to return user information without updating the last-activity date/time stamp for the user.

返回

用数据源中指定用户的信息填充的 MembershipUser 对象。A MembershipUser object populated with the specified user's information from the data source.

示例

有关MembershipProvider实现的示例,请参阅实现配置文件提供程序For an example of a MembershipProvider implementation, see Implementing a Profile Provider.

注解

采用用户记录的唯一标识符和指示是否更新LastActivityDate用户的值的布尔值作为输入,以显示用户当前是否处于联机状态。Takes, as input, a unique identifier for a user record and a Boolean value indicating whether to update the LastActivityDate value for the user to show that the user is currently online. 方法返回使用指定用户的数据源中的当前值填充的对象。MembershipUser GetUserThe GetUser method returns a MembershipUser object populated with current values from the data source for the specified user. 如果在数据源中找不到该用户名, GetUser则返回。 nullIf the user name is not found in the data source, GetUser returns null.

另请参阅

适用于