password attempts


B

bbawa1

have a username and opassword text boxes and one login button. When I
type password it checks three times weather my username and password
is correct or not. After 3 failed attempts it gives me message that
Notify your administrator.

I used form Authnication. How can I count weather user attempts 3
times. My username and password is stored in database
 
Ad

Advertisements

C

Cowboy \(Gregory A. Beamer\)

The easiest way is to set up a session variable and increment:

if(failedLogin)
Session("failedAttempts") = int.Parse(Session("FailedAttempts")) + 1;

You can then disable the account in the database when this hits three and
any time they try to log in after that kicks them.

A more full method is to have failed attempts in the database and increment
each time they fail, reset to 0 if succesful. If you like this model, the
easiest way to get it is to use the ASP.NET built in membership model. It
automatically does this for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top