Visual Guard Class Library Documentation

VGMembershipUser.ChangePasswordQuestionAndAnswer Method 

Updates the password question and answer for the membership user in the Visual Guard repository

public bool ChangePasswordQuestionAndAnswer(
   String password,
   String newPasswordQuestion,
   String newPasswordAnswer
);

Parameters

password
The current password for the membership user.
newPasswordQuestion
The new password question value for the membership user.
newPasswordAnswer
The new password answer value for the membership user.

Return Value

true if the update was successful; otherwise, false.

Remarks

Visual Guard is case sensitive when it checks the password answer. We strongly recommend to store the password answer as a lowered string and to provide a lowered value of the password answer when you want to reset the password by using the password question and answer.

user.ChangePasswordQuestionAndAnswer(myPassword.Text, newPasswordQuestion.Text, newPasswordAnswer.Text.ToLowerInvariant())

user.ResetPassword(myPasswordAnswer.Text.ToLowerInvariant())

Exceptions

Exception TypeCondition
ArgumentNullExceptionpassword is null

or

newPasswordQuestion is null and the RequiresQuestionAndAnswer is set to true.

or

newPasswordAnswer is null and newPasswordQuestion is not null or empty.
ArgumentExceptionpassword 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.

See Also

VGMembershipUser Class | Novalys.VisualGuard.Security.Membership Namespace