0

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

Edited by __avd: Added [code] tags.

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jlego
0

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.

Edited by jlego: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.