Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in my web application i have a login form. if anyone enters a wrong password more than 5 times, i want to lock that user for some time. how can i do so? any suggestions?

using session is definitely a bad idea, any good idea for carrying out that task?
Posted

1 solution

Try This One...
<connectionstrings>
  <add name="ApplicationServices">
    connectionString=
      "data source=.\SQLEXPRESS;
      Integrated Security=SSPI;
      AttachDBFilename=|DataDirectory|\aspnetdb.mdf;
      User Instance=true" 
      providerName="System.Data.SqlClient"/>
</add></connectionstrings>
  
<system.web>    
  <authentication mode="Forms">
     <forms loginurl="~/Login.aspx" timeout="2880" />
  </authentication>
</system.web>


After This U can Use Membership...

<system.web>

<membership>
<providers>
  <clear />
  <add name="AspNetSqlMembershipProvider">
    type="System.Web.Security.SqlMembershipProvider"
    connectionStringName="ApplicationServices"
    enablePasswordRetrieval="false"
    enablePasswordReset="true"
    requiresQuestionAndAnswer="false"
    requiresUniqueEmail="false"
    maxInvalidPasswordAttempts="5"
    minRequiredPasswordLength="6"
    minRequiredNonalphanumericCharacters="0"
    passwordAttemptWindow="10"
    applicationName="/"/>
</add></providers>
</membership>
    
<profile>
<providers>
  <clear />
  <add name="AspNetSqlProfileProvider">
    type="System.Web.Profile.SqlProfileProvider"
    connectionStringName="ApplicationServices"
    applicationName="/"/>
</add></providers>
</profile>
    
<rolemanager enabled="false">
<providers>
  <clear />
  <add name="AspNetSqlRoleProvider">
    type="System.Web.Security.SqlRoleProvider"
    connectionStringName="ApplicationServices" 
    applicationName="/"/>
  <add name="AspNetWindowsTokenRoleProvider">
    type="System.Web.Security.WindowsTokenRoleProvider" 
    applicationName="/"/>
</add></add></providers>
</rolemanager>
    
</system.web>
 
Share this answer
 
v3
Comments
Neerajan Lamsal 24-Jun-11 1:00am    
thanx for the solution. does this help to lock the user for few minutes?
is not how can the feature be implemented?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900