How to lock password if wrong password enterd 3 times
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
Hi Veeru, I guess you want to lock the table for that particular user, not for others, Correct........... Here is your Answer: When user enter password, take a count of his attempts. This you will have to do on the Ok button. Whenever he clicks on OK button after supplying the password, the value of Count will increase by 1. Every time you check the value of count.If it is 3 then fire a Update SQL Query to change Unlock value from 1 to 0. Lets Try this.........:laugh: Binod
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
you can use a simple counter for that :)
Best Regards ----------------- Abhijit Jana View My CodeProject Articles "Success is Journey it's not a destination"
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
Hi, As suggested by other other fellows, have a counter in authentication procedure/routine, count for invalid tries, and if the count reaches 3, change the ULock to 0. You can even add a column for the total number of times the account ws locked in the same column. Just an idea! :) Regards, Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
I wil just tell u the Procedure to be done. 1.Initailly the default value of ULock will be 1. 2. Declare a variable WrongPwdCount=0; 3.Check the status of the ULock if ULock==0 Display the Message as " Your account is locked" else WrongPwdCount++; 4. if WrongPwdCount==3 Change the ULock=0 else Do a successful login Let me know if this works.... Otherwise Let me send a code for the same Regards Basavarajayya
-
Hi All, Iam having one table in that i have 3 fields UserId Password ULock veeresh xyz 1 1-Unlock 0-Lock If some budy enters wrong password 3 times that userid should be locked. i.e ULock value should be 0.I need c# code for this.Please help me on this.
i want to join this group
Try This. SqlConnection con = new SqlConnection("Data Source=;Database=;User Id=;Password="); SqlCommand cmd; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hfCounter.Value = "1"; } } protected void btLogin_Click(object sender, EventArgs e) { try { con.Open(); string xSql="select * from where userid='" + txtUser.Text + "' and pswd='" + txtPswd.Text + "'"; cmd = new SqlCommand(xSql,con); SqlDataReader rd = cmd.ExecuteReader(); int x = Convert.ToInt32(hfCounter.Value); if (x == 3) { lblMsg.Text = "User Locked....!"; // write your process here. to change the Lock Status from 0 to 1 OR 1 to 0 etc... } else { if (rd.HasRows != true) { x++; hfCounter.Value = x.ToString(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { con.Close(); } } I hope Helps you out. I used Two TextBox, Label, Button, HiddenField :rolleyes:
" Good Things Goes with Good People "