Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
when a user enter wrong password in three times its username and password will be to set this condition in and c#?
Pheonyx 26-Feb-14 4:37am    
What have you tried? Where is your validation logic?
[no name] 26-Feb-14 4:48am    
when a candidate login his account he was enter wrong password ..three times he can enter the password when he attempt the 4th time his account will be to set this validation?

1 solution

make a boolean field (e.g. blocked) that represent the account blocked or not in database table in which you store the users and set it to 0 or false.

now whenever a user try to attempt login check it is blocked or not. if it is blocked just return whatever you want.

now for login make a query string variable e.g. called attempt and set it to 0(try to login on facebook with wrong paassword and see). whenever a user enters the wrong password or user name! increament the attempt variable in query string. when attempt variable reaches to 3 set the blocked field to true or 1. and now when user try to login again show the message that your account is blocked.
Share this answer
[no name] 26-Feb-14 4:46am    
can u give some examples...

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