Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

I am logging date/time/username/IP/Payload to a ms sql db everytime a user tries to log in. (payload = 'auth failed' or 'auth successful')

 

I want to set it up so, if a user fails to provide a valide username/pw 3 times within 30 minutes, he will not be able to login for the next 30 minutes (30 minutes can start from his first login attempt.. or last.. i don't care)

 

This is what I have so far:

 

Dim MyCommand As New OleDbCommand("SELECT * FROM Login_Attempts WHERE Username = '" & UsernameTry & "' and Payload = 'Auth Failed'", MyConnection) 

 

So right now.. it isn't even checking the time or date..

 

But I stored the time via:

date.Now.ToLongTimeString (but I could store this differently)

and

Date.Now.Date

 

 

How can I check and see if a user has failed to login 3 times with 30 minutes?

 

 

thanks

Lee

Edited by trend

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...