Updates the password question and answer for the membership user in the Visual Guard repository
Namespace: Novalys.VisualGuard.Security.MembershipAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
public bool ChangePasswordQuestionAndAnswer( string newPasswordQuestion, string newPasswordAnswer ) |
Visual Basic |
---|
Public Function ChangePasswordQuestionAndAnswer ( newPasswordQuestion As String, newPasswordAnswer As String ) As Boolean |
Parameters
- newPasswordQuestion
- Type: System..::..String
The new password question value for the membership user.
- newPasswordAnswer
- Type: System..::..String
The new password answer value for the membership user.
Return Value
Type: Booleantrue if the update was successful; otherwise, false.
Remarks
The password answer check is case sensitive. We strongly recommend to store the password answer as a lowered string and provide a lowered value of the password answer when you want to reset the password by using the password question and answer.
C# | Copy |
---|---|
<para> user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant()) </para><para> user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant()) </para> |
Visual Basic | Copy |
---|---|
<para> user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant()) </para><para> user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant()) </para> |
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | password is null
or newPasswordQuestion is null and the RequiresQuestionAndAnswer is set to true.or newPasswordAnswer is null and newPasswordQuestion is not null or empty. |
System..::..ArgumentException | password or newPasswordAnswer is longer than 64 characters.
or newPasswordQuestion is empty or longer than 256 characters or newPasswordQuestion is empty or null and the repository property "Requires Question And Answer" is set to true. |