SimpleMembershipProvider.ChangePasswordQuestionAndAnswer Method
Changes the password question and answer for the specified account.
Namespace: WebMatrix.WebData
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Syntax
'Declaration
Public Overrides Function ChangePasswordQuestionAndAnswer ( _
username As String, _
password As String, _
newPasswordQuestion As String, _
newPasswordAnswer As String _
) As Boolean
'Usage
Dim instance As SimpleMembershipProvider
Dim username As String
Dim password As String
Dim newPasswordQuestion As String
Dim newPasswordAnswer As String
Dim returnValue As Boolean
returnValue = instance.ChangePasswordQuestionAndAnswer(username, _
password, newPasswordQuestion, newPasswordAnswer)
public override bool ChangePasswordQuestionAndAnswer(
string username,
string password,
string newPasswordQuestion,
string newPasswordAnswer
)
public:
virtual bool ChangePasswordQuestionAndAnswer(
String^ username,
String^ password,
String^ newPasswordQuestion,
String^ newPasswordAnswer
) override
abstract ChangePasswordQuestionAndAnswer :
username:string *
password:string *
newPasswordQuestion:string *
newPasswordAnswer:string -> bool
override ChangePasswordQuestionAndAnswer :
username:string *
password:string *
newPasswordQuestion:string *
newPasswordAnswer:string -> bool
public override function ChangePasswordQuestionAndAnswer(
username : String,
password : String,
newPasswordQuestion : String,
newPasswordAnswer : String
) : boolean
Parameters
- username
Type: System.String
The user name.
- password
Type: System.String
The new password.
- newPasswordQuestion
Type: System.String
The security question that the user must answer in order to change the password.
- newPasswordAnswer
Type: System.String
The answer to the security question.
Return Value
Type: System.Boolean
true if the password question and answer are successfully changed; otherwise, false.
Remarks
Note
If the SimpleMembershipProvider class has been initialized using a call to the WebSecurity.InitializeDatabaseConnection() method, this method is not supported and will throw a NotSupportedException exception. However, if the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET membership provider, this method is passed through to the standard membership provider. For more information, see the SimpleMembershipProvider class overview.