WebSecurity ChangePassword method
definition
ChangePassword () method to change the password for the specified user.
C # and VB syntax
WebSecurity.ChangePassword( userName,
oldPassword, newPassword )
parameter
参数 | 类型 | 描述 |
---|---|---|
userName | String | 用户名 |
oldPassword | String | 用户的旧密码 |
newPassword | String | 新密码 |
return value
类型 | 描述 |
---|---|
Boolean | 如果密码被更改,则返回 true ,否则返回 false 。 |
Errors and exceptions
In the following scenario, any access to WebSecurity object will throw an InvalidOperationException:
- InitializeDatabaseConnection () method has not been called
- SimpleMembership not initialized (or disabled in the site configuration)
Technical data
名称 | 值 |
---|---|
Namespace | WebMatrix.WebData |
Assembly | WebMatrix.WebData.dll |
WebSecurity objects