这里是我的代码和错误的情况。
我sqlite3的开发与使用Visual Studio ASP.NET 4.0网站和我运行
TechInfoSystems.Data.SQLiteProvider.dll
和
1.0.66.0 System.Data.SQLite.dll
我刚刚决定,我不能保存用户登录我的数据库中明文密码,所以我现在使用SHA1哈希他们。登录仍然有效,伟大的和单向的十六进制值现在的密码都保存在数据库中,这就是我想要的。
这虽然是需要足够的密码恢复。我把login.aspx页面上重置密码的链接,此链接将带您到ResetPassword.aspx其中包含ASP.NET控制的PasswordRecovery。我改变模板的用户名,问题,和成功的部分,为不同的格式。
现在,用户重定向到ResetPassword.aspx,当用户被提示输入自己的用户名。太棒了!然后点击提交按钮,出现的问题模板要求用户安全问题的答案是什么。太棒了!这里的问题是,如果用户输入的密码不正确,没有显示成功页面,页面坐在他们的处理。 〜20秒后,我看到了一个错误,说数据库被锁定。这里是,确切的错误:
数据库文件被锁定{BR}数据库被锁定{BR}
说明:执行当前Web请求期间,出现未处理的异常。请检讨有关错误的更多信息,堆栈跟踪,它起源于代码。
异常详细信息:System.Data.SQLite.SQLiteException:数据库文件被锁定{BR}数据库被锁定{BR}
源错误:
执行当前Web请求期间生成了未处理的异常。有关的起源和异常的位置,可以使用下面的异常堆栈跟踪标识
堆栈跟踪:
[SQLiteException(0X80004005):数据库文件被锁定{BR}数据库被锁定]
System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt的)499
System.Data.SQLite.SQLiteDataReader.NextResult()249
System.Data.SQLite.SQLiteDataReader ..构造函数(SQLiteCommand CMD,CommandBehavior的行为)79
System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior行为)38
System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()39
TechInfoSystems.Data.SQLite.SQLiteMembershipProvider.UpdateFailureCount(弦乐用户名,字符串failureType,布尔isAuthenticated)2265
TechInfoSystems.Data.SQLite.SQLiteMembershipProvider.ResetPassword(弦乐用户名,弦乐passwordAnswer)1760
System.Web.Security.MembershipUser.ResetPassword(字符串passwordAnswer)110
System.Web.Security.MembershipUser.ResetPassword(弦乐passwordAnswer useAnswer,布尔,布尔throwOnError)48
System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordQuestionView()374
System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword()77
System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(源对象,EventArgs的五)103
&
#160; System.Web.UI.Control.RaiseBubbleEvent(源对象,EventArgs的ARGS)37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs的E)125
,弦乐System.Web.UI.WebControls.Button.RaisePostBackEvent(eventArgument)167
&
#160; ,弦乐System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(eventArgument)10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl的String eventArgument)13
System.Web.UI.Page.RaisePostBackEvent(POSTDATA的NameValueCollection)36
160; System.Web.UI.Page.ProcessRequestMain(includeStagesBeforeAsyncPoint布尔,布尔includeStagesAfterAsyncPoint)5563
这里是我的代码:<%@ Page Title="Change Password" Language="C#" MasterPageFile=" /Site.master" AutoEventWireup="true"
CodeFile="ResetPassword.aspx.cs" Inherits="Account_ChangePassword" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Reset Password
</h2>
<asp:PasswordRecovery ID="PasswordRecovery" runat="server" Height="104px" Width="409px" Enabled="True" ViewStateMode="Disabled" MembershipProvider="SQLiteMembershipProvider">
<MailDefinition IsBodyHtml="True" From="No-Reply@gmail.com" >
</MailDefinition>
<UserNameTemplate >
<fieldset class="passwordRecovery">
<legend>Password Recovery</legend>
<p>
<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Username:</asp:Label>
<asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required."
ValidationGroup="PasswordRecovery1">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:ValidationSummary ID="LoginUserValidationSummary" runat="server"
CssClass="failureNotification" Height="37px"
ValidationGroup="PasswordRecovery1" Width="378px" />
<p>
<br />
</p>
</p>
</fieldset>
<p align="right">
<asp:Button ID="Submit" runat="server" CommandName="Submit" Text="Submit"
ValidationGroup="passwordRecovery" />
</p