Share via


ResetPassword Method

Resets a user's password to a new, automatically generated password.

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

Syntax

'Declaration
Public Overrides Function ResetPassword ( _
    username As String, _
    answer As String _
) As String
'Usage
Dim instance As UpmMembershipProvider
Dim username As String
Dim answer As String
Dim returnValue As String

returnValue = instance.ResetPassword(username, _
    answer)
public override string ResetPassword(
    string username,
    string answer
)
public:
virtual String^ ResetPassword(
    String^ username, 
    String^ answer
) override
public override function ResetPassword(
    username : String, 
    answer : String
) : String

Parameters

  • username
    Type: System..::.String
    The user to reset the password for. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).

Return Value

Type: System..::.String
The new password for the specified user.

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentException

EnablePasswordReset is set to false.

ArgumentException

username is an empty string or contains invalid characters.

Remarks

Resets a user's password to a new, automatically generated password. The username is trimmed. To reset the password EnablePasswordReset must be set to true.

Permissions

See Also

Reference

UpmMembershipProvider Class

UpmMembershipProvider Members

Microsoft.CommerceServer.Runtime.Profiles Namespace