MembershipProvider.ChangePassword(String, String, String) 方法

定义

处理更新成员资格用户密码的请求。Processes a request to update the password for a membership user.

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

参数

username
String

要为其更新密码的用户。The user to update the password for.

oldPassword
String

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

newPassword
String

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

返回

Boolean

如果密码更新成功,则为 true;否则为 falsetrue if the password was updated successfully; otherwise, false.

示例

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

注解

使用输入、用户名、当前密码和新密码,如果提供的用户名和当前密码有效,则会更新数据源中的密码。Takes, as input, a user name, a current password, and a new password, and updates the password in the data source if the supplied user name and current password are valid.

适用于