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: 2017.0.101.17 (2017.0.101.17)
Syntax
C# |
---|
public override string ResetPassword( string username, string passwordAnswer ) |
Visual Basic |
---|
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
Type: StringThe 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. |