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 對象