VB Code:
Dim intCount As Integer = 0
Private Sub grp1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles grp1.Click
Dim Username As String = New String("mark")
Dim Password As String = New String("pass")
intCount = intCount + 1
If intCount >= 3 Then
MsgBox("Contact your administrator for more Info ")
Exit Sub
End If
If (txtUser.Text) = "mark" And _
(txtPass.Text) = "Pass" Then
MsgBox("Logged in...", MsgBoxStyle.Information, "Logged in...")
Else
If Not (txtUser.Text) = "mark" Then
MsgBox("worng username", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Auth")
Exit Sub
Else
If Not (txtPass.Text) = "pass" Then
MsgBox("wrong password", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly, "Auth.")
End If
End If
End If
End Sub