Partilhar via


ChangePassword Method

Processes a request to update the password for a membership user.

Namespace:  Microsoft.CommerceServer.Runtime.Profiles
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Overrides Function ChangePassword ( _
    username As String, _
    oldPassword As String, _
    newPassword As String _
) As Boolean
'Usage
Dim instance As UpmMembershipProvider
Dim username As String
Dim oldPassword As String
Dim newPassword As String
Dim returnValue As Boolean

returnValue = instance.ChangePassword(username, _
    oldPassword, newPassword)
public override bool ChangePassword(
    string username,
    string oldPassword,
    string newPassword
)
public:
virtual bool ChangePassword(
    String^ username, 
    String^ oldPassword, 
    String^ newPassword
) override
public override function ChangePassword(
    username : String, 
    oldPassword : String, 
    newPassword : String
) : boolean

Parameters

  • username
    Type: System..::.String
    The name of the user to update the password for. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • oldPassword
    Type: System..::.String
    The current password for the specified user. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • newPassword
    Type: System..::.String
    The new password for the specified user. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: System..::.Boolean
true if the password was updated successfully; otherwise false.

Exceptions

Exception Condition
ArgumentNullException

username or oldPassword or newPassword is nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

The ChangePassword method is used to update the user's password in the UpmMembershipProvider data store.

If the EnablePasswordReset is false, the user cannot change their password.

If the EnablePasswordReset is true, and the account was previously locked because the user made too many attempts to answer the password question, the user cannot change their password.

Permissions

See Also

Reference

UpmMembershipProvider Class

UpmMembershipProvider Members

Microsoft.CommerceServer.Runtime.Profiles Namespace