建立一個應用程序,我有一些PasswordRecovery實用程序的麻煩。我正在使用配置工具中內置的ASP.NET。我的問題是我無法使用提供的PasswordRecovery控件,因爲我沒有安裝SMTP服務器,也不知道如何操作。PasswordRecovery問題
我試圖自定義控件,以允許我在成功密碼恢復後在標籤內顯示用戶密碼。這是我到目前爲止的代碼:
protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
{
e.Cancel = true;
MembershipUser user;
user = Membership.GetUser(PasswordRecovery1.UserName);
label1.Text = user.GetPassword();
}
這是我收到的錯誤:
This Membership Provider has not been configured to support password retrieval.
現在我做了這個錯誤一些研究和跨一個奇怪的來到。 ASP.NET工具沒有將任何類型的Membership Provider添加到我的web.config文件中。此外,當我試圖通過這裏的配置工具來測試數據庫是我所得到的:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
任何人可以幫助我成功的密碼恢復後訪問用戶的密碼?如果SMTP很容易就可以嘗試,但我認爲在標籤上顯示用戶密碼會更容易一些?
在此先感謝。
密碼恢復是**壞主意**無論如何。您希望提供_reset機制_而不是完全恢復,因爲您不應該以首先可逆的方式存儲密碼。 – 2012-01-31 05:28:20
我同意。無論哪種方式確定...但我不能設置enablePasswordReset =「true」,因爲它會引發我當前的配置錯誤。 – shenn 2012-01-31 05:33:08