Resets a user's password to a new, automatically generated password.
Namespace:
Novalys.VisualGuard.Security.WebFormAssembly: Novalys.VisualGuard.Security.WebForm (in Novalys.VisualGuard.Security.WebForm.dll) Version: 3.2.912.1 (3.2.912.01)
Syntax
C# |
---|
public override string ResetPassword( string username, string passwordAnswer ) |
Visual Basic (Declaration) |
---|
Public Overrides Function ResetPassword ( _ username As String, _ passwordAnswer As String _ ) As String |
Parameters
- username
- Type: System..::.String
the user to reset the password for.
- passwordAnswer
- Type: System..::.String
The password answer for the specified user.
Return Value
The new password for the specified user.Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | username is null.
or If RequiresQuestionAndAnswer is set to true and the passwordAnswer is empty. |
System..::.ArgumentException | username or passwordAnswer is longer than 64 characters. |
System..::.NotSupportedException | If EnablePasswordReset is not set to true. |
System.Web.Security..::.MembershipPasswordException | passwordAnswer is invalid or user account is locked out. |