我尝试做三次不使用数据库尝试失败后锁定用户的研究,并且我找到了与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