Kopīgot, izmantojot


ChangePassword Method

Updates the password for the membership user in the membership data store.

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

Syntax

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

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

Parameters

  • oldPassword
    Type: System..::.String
    The current password for the membership user. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
  • newPassword
    Type: System..::.String
    The new password for the membership 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

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.

Permissions

See Also

Reference

UpmMembershipUser Class

UpmMembershipUser Members

Microsoft.CommerceServer.Runtime.Profiles Namespace