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;如果返回用户信息而未更新用户的上一次活动日期/时间戳,则为 falsetrue 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

使用来自数据源的指定用户信息进行填充的 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;如果返回用户信息而未更新用户的上一次活动日期/时间戳,则为 falsetrue 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

使用来自数据源的指定用户信息进行填充的 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. GetUser方法返回 MembershipUser 使用指定用户的数据源中的当前值填充的对象。The 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.

适用于