SimpleMembershipProvider.GeneratePasswordResetToken Method (String, Int32)

Generates a password reset token that can be sent to a user in email.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

Syntax

'Declaration
Public Overrides Function GeneratePasswordResetToken ( _
    userName As String, _
    tokenExpirationInMinutesFromNow As Integer _
) As String
'Usage
Dim instance As SimpleMembershipProvider 
Dim userName As String 
Dim tokenExpirationInMinutesFromNow As Integer 
Dim returnValue As String 

returnValue = instance.GeneratePasswordResetToken(userName, _
    tokenExpirationInMinutesFromNow)
public override string GeneratePasswordResetToken(
    string userName,
    int tokenExpirationInMinutesFromNow
)
public:
virtual String^ GeneratePasswordResetToken(
    String^ userName, 
    int tokenExpirationInMinutesFromNow
) override
abstract GeneratePasswordResetToken : 
        userName:string * 
        tokenExpirationInMinutesFromNow:int -> string  
override GeneratePasswordResetToken : 
        userName:string * 
        tokenExpirationInMinutesFromNow:int -> string
public override function GeneratePasswordResetToken(
    userName : String, 
    tokenExpirationInMinutesFromNow : int
) : String

Parameters

  • tokenExpirationInMinutesFromNow
    Type: System.Int32
    (Optional) The time, in minutes, until the password reset token expires. The default is 1440 (24 hours).

Return Value

Type: System.String
A token to send to the user.

Exceptions

Exception Condition
ArgumentException

username is empty.

ProviderException

The database operation failed.

InvalidOperationException

The SimpleMembershipProvider class was not initialized using a call to the InitializeDatabaseConnection() method.

See Also

Reference

SimpleMembershipProvider Class

GeneratePasswordResetToken Overload

WebMatrix.WebData Namespace