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)
'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
- username
Type: System..::.String
The user to reset the password for. Cannot be nullNothingnullptra null reference (Nothing in Visual Basic).
- answer
Type: System..::.String
The password answer for the specified user.
Type: System..::.String
The new password for the specified user.
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. |
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.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.