我嘗試做三次不使用數據庫嘗試失敗後鎖定用戶的研究,並且我找到了與SQLMemberShipProvider一起使用它的答案。我修改th Web.config:用maxInvalidPasswordAttempts鎖定用戶不起作用
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOnCust" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="WebDBConnection"
maxInvalidPasswordAttempts="3"
minRequiredPasswordLength="6"
passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
但它不工作,我不知道爲什麼。我需要做些什麼修改才能使更多?
maxInvalidPasswordAttempts =「5」!= 3 http://msdn.microsoft.com/en-us/library/system.web.security.membership.maxinvalidpasswordattempts.aspx – xQbert 2011-12-28 02:02:11
那麼你是說你沒有使用數據庫?或者你是和看不到字段增量作爲無效的密碼嘗試發生? – uadrive 2011-12-28 02:06:56
@uadrive:我試過了,用我自己的帳戶用不正確的密碼登錄了3次,但我仍然可以在第4次登錄網頁。所以我不知道我能做什麼或看到有關錯誤。 – Nothing 2011-12-28 02:16:09