Latest web development tutorials

WebSecurity GetPasswordChangeDate method

WebSecurity objects WebSecurity objects

definition

GetPasswordChangeDate () method returns the date and time of the user's password last changed.


C # and VB syntax

WebSecurity.GetPasswordChangedDate( userName )


parameter

参数 类型 描述
userName String 用户名


return value

类型 描述
DateTime

密码最后更改的日期和时间



Errors and exceptions

In the following scenario, any access to WebSecurity object will throw an InvalidOperationException:

  • The InitializeDatabaseConnection () method has not been called
  • SimpleMembership not initialized (or disabled in the site configuration)

Remark

If the password is not changed, then GetPasswordChangeDate () method returns DateTime.MinValue.

DateTime.MinValue value is 00: 00: 00.0000000, January 1, 0001.


Technical data

名称
Namespace WebMatrix.WebData
Assembly WebMatrix.WebData.dll


WebSecurity objects WebSecurity objects