Hey Give me the solution of this below code i am unable to do that three attempt login step....
i am using MS-ACCESS for connectivity please do help soon
thanks in ADV....

Dim cnt As Integer
Dim i As Integer
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If UsernameTextBox.Text = "r" And PasswordTextBox.Text = "46" Then
Form1.Show()
ElseIf UsernameTextBox.Text = "j" And PasswordTextBox.Text = "03" Then
Form1.Show()
ElseIf UsernameTextBox.Text = "m" And PasswordTextBox.Text = "10" Then
Form1.Show()
Else
If i = 2 Then
Me.Close()
Else

i = i + 1
MsgBox("Error Invalid User Name Or Password")

End If
End If
Me.Close()
End Sub

mail me the solution on rushabh930@gmail.com

well thats a horrible login system.

scratch the original code - was thinking of something else for some reason

class form1

private i as integer = 1

private sub button1_click
if i = 3 then application.exit

If UsernameTextBox.Text = "r" And PasswordTextBox.Text = "46" Then
Form1.Show()
ElseIf UsernameTextBox.Text = "j" And PasswordTextBox.Text = "03" Then
Form1.Show()
ElseIf UsernameTextBox.Text = "m" And PasswordTextBox.Text = "10" Then
Form1.Show()
else
me.i = i + 1
end if

end sub

end class

this is how you would make your horrible login work though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.