Latest web development tutorials

WebSecurity GetPasswordChangeDate 方法

WebSecurity 對象 WebSecurity對象

定義

GetPasswordChangeDate()方法返回用戶的密碼最後更改的日期和時間。


C# 和VB 語法

WebSecurity.GetPasswordChangedDate( userName )


參數

参数 类型 描述
userName String 用户名


返回值

类型 描述
DateTime

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



錯誤和異常

在下面的情況下,任何對WebSecurity對象的訪問將拋出一個InvalidOperationException

  • The InitializeDatabaseConnection()方法沒有被調用
  • SimpleMembership沒有初始化(或者在網站配置中禁用)

備註

如果密碼沒有更改,則GetPasswordChangeDate()方法返回DateTime.MinValue

DateTime.MinValue 的值是00:00:00.0000000, January 1, 0001。


技術數據

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


WebSecurity 對象 WebSecurity對象