WebSecurity - GetPasswordChangeDate()
WebSecurity Object
Definition
GetPasswordChangeDate()The method returns the date and time when the user's password was last changed.
C# and VB Syntax
WebSecurity.GetPasswordChangedDate(userName)
Parameters
| Parameters | Type | Description |
|---|---|---|
| userName | String | User name |
Return Value
| Type | Description |
|---|---|
| DateTime |
The date and time when the password was last changed |
Errors and Exceptions
Under the following circumstances, any access to theWebSecurityobject will throw anInvalidOperationException:
- The InitializeDatabaseConnection()The method has not been called
- SimpleMembershipNot initialized (or disabled in website configuration)
Remarks
If the password has not been changed, theGetPasswordChangeDate()method returnsDateTime.MinValue。
DateTime.MinValue, which is 00:00:00.0000000, January 1, 0001.
Technical Data
| Name | Value |
|---|---|
| Namespace | WebMatrix.WebData |
| Assembly | WebMatrix.WebData.dll |
WebSecurity Object Other Extensions