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)

'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)

Parameters

userName
Type: System.String
The user name.
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.

ExceptionCondition
ArgumentException

username is empty.

ProviderException

The database operation failed.

InvalidOperationException

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

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
Show: