MembershipProvider.ValidateUser(String, String) 方法

定义

验证数据源中是否存在指定的用户名和密码。Verifies that the specified user name and password exist in the data source.

public:
 abstract bool ValidateUser(System::String ^ username, System::String ^ password);
public abstract bool ValidateUser (string username, string password);
abstract member ValidateUser : string * string -> bool
Public MustOverride Function ValidateUser (username As String, password As String) As Boolean

参数

username
String

要验证的用户的名称。The name of the user to validate.

password
String

指定的用户的密码。The password for the specified user.

返回

如果指定的用户名和密码有效,则为true ;否则为 falsetrue if the specified username and password are valid; otherwise, false.

示例

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

注解

采用用户名和密码作为输入,并验证这些值是否与数据源中的值匹配。Takes, as input, a user name and a password and verifies that the values match those in the data source. ValidateUser如果true用户名和密码匹配成功,则返回; false否则返回。ValidateUser returns true for a successful user name and password match; otherwise, false.

若要成功进行ValidateUser验证, LastLoginDate请更新指定用户的。For successful validations, ValidateUser updates the LastLoginDate for the specified user.

适用于

另请参阅