Share via


WebSecurity.GetPasswordChangedDate Method

Returns the date and time when the password was most recently changed for the specified membership account.

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

Syntax

'Declaration
Public Shared Function GetPasswordChangedDate ( _
    userName As String _
) As DateTime
'Usage
Dim userName As String 
Dim returnValue As DateTime 

returnValue = WebSecurity.GetPasswordChangedDate(userName)
public static DateTime GetPasswordChangedDate(
    string userName
)
public:
static DateTime GetPasswordChangedDate(
    String^ userName
)
static member GetPasswordChangedDate : 
        userName:string -> DateTime
public static function GetPasswordChangedDate(
    userName : String
) : DateTime

Parameters

Return Value

Type: System.DateTime
The date and time when the password was most recently changed, or DateTime.MinValue if the password has not been changed for this account.

Exceptions

Exception Condition
InvalidOperationException

The SimpleMembershipProvider.Initialize(String, NameValueCollection) method was not called.

-or-

The InitializeDatabaseConnection() method was not called.

-or-

The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.

See Also

Reference

WebSecurity Class

WebMatrix.WebData Namespace