| | |
session counter
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2007
Posts: 276
Reputation:
Solved Threads: 37
I'm fairly new to asp.net and trying to use a session counter to check for when someone has tried to log in three times it counts and when reaches three it locks them out. I know it's easy but my brain is fried.
Can someone direct me the proper way?
ASP.NET Syntax (Toggle Plain Text)
Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click Dim IsFound As Boolean = False If Page.IsPostBack Then IsFound = clsDataLayer.GetUser(Server.MapPath("AddressBook.mdb"), txtUSERID.Text, txtPassword.Text) If (IsFound) Then 'user credentials were found in the database so notify the system that the user is authenticated lblStatus.Text = "Welcome" 'if authentic then wait three seconds to display the welcome label then send user to mymobilepage Response.AddHeader("REFRESH", "3;URL=mymobilepage.aspx") Else 'invalid user credentials Dim myAttempts As Integer = Convert.ToInt16(Session("AttemptsCount ")) myAttempts = myAttempts + 1 Session("AttemptCount") = myAttempts 'update the session variable with the new value lblStatus.Text = "The User ID and/or Password supplied is incorrect. Please try again!" If myAttempts >= 3 Then Dim myDAL As New clsDataLayer myDAL.Lockuser(Server.MapPath("Addressbook.mdb"), txtUSERID.Text, False) lblStatus.Text = "Your account has been locked and will need to be reset by the system administrator!" End If End If End If
Can someone direct me the proper way?
![]() |
Similar Threads
- Back Button problem (PHP)
- difference between session and application scope at jsp (JSP)
- Hit counter (JavaScript / DHTML / AJAX)
- Determine if session exists (PHP)
- Login used to work (ASP.NET)
- URGENT! Loading Roles From ticket.UserData (ASP.NET)
- loading roles from DB to auth cookie (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: session counter
- Next Thread: Label click event
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dropdownlist dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list login menu microsoft mono mssql multistepregistration nameisnotdeclared numerical objects order panelmasterpagebuttoncontrols problem ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sqlserver2005 ssl suse textbox tracking unauthorized validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment webservice wizard xml youareanotmemberofthedebuggerusers





