Click here to Skip to main content

mahesh.b.p.c asked:

Open original thread
Hi folk's
 
Can any one help me out ,i done coding for if attempts 3 invalid user attempts by taking int static count variable,in that i have one drawback ,if one user made 2 invalid attempts ,and other user made 1st time invalid attempt and this account is blocking ,How can i rectify this problem can any one help me....
 
I placing my code below please check it out yar and tell me with one is the better option .....
 
static int count = 0;
    public void  count_log()//this my user count static function............
    {
        BAL_ClassLibrary.Rcm_service.LoginEntities get_login_details = login_values();
        if (count >2)
        {
            Loginbal objbal=new Loginbal();
             objbal.account_block(get_login_details);
             ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "Result", "alert('*Your Account is blocked')", true);
               count = 0;
 
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "Result", "alert('*Invalied username or password')", true);
            count++;
        }
 
I am calling this function, when user made invalid user attempt to login...
and i incrementing the count value.....
Tags: C#4.0, ASP.NET

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).



Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100