Public Class FrmSecurityProgram
Private Sub BtnOK_Click(sender As System.Object, e As System.EventArgs) Handles BtnOK.Click
Dim ans As String
'Dim ctr1 As Integer
'While ctr1 <= 3
If Txtusername.Text = "julie" And Txtpassword.Text = "mamatra" Then
MsgBox("Access Granted!")
Me.Hide()
FrmSimpleMath.ShowDialog()
Else
ans = MsgBox("Access Denied! Try Again?", MsgBoxStyle.YesNo + MsgBoxStyle.Critical)
If ans = MsgBoxResult.Yes Then
Txtpassword.Clear()
Txtusername.Clear()
Txtusername.Focus()
End If
End If
'End While
End Sub
End Class
it is a simple security program where it will ask for username and password. the user just have 3 times to try and when its the fourth try the msgbox will show and will tell the user that he exceeds the maximum number of try.
im still a student now and i really want to know how this could work thank you in advance

New Topic/Question
Reply



MultiQuote






|