我是第一次上这个论坛,用vb做毕业设计的时候遇到一些问题,这是的输入三次不正确的密码或帐号后自动退出的登陆窗口,可我试了很久都没有达到我想要的的效果,希望哪位大哥大姐帮帮忙看一下,我究竟应该如何写这段代码?谢谢了!!!
If Text1.Text <> sa Or Text2.Text <> sa Then
MsgBox "you are not an account!"
Unload Me
If Text1.Text = sa And Text2.Text <> sa Then
MsgBox "please entry correct password!"
try_times = try_times + 1
If try_times >= 3 Then
MsgBox "you have tried three times but failed!we must close it now"
Unload Me
End If
If Text1.Text <> sa And Text2.Text = sa Then
MsgBox "please user valid account!"
try_times = try_times + 1
If try_times >= 3 Then
MsgBox "you have tried three times but failed!we must close it now"
Unload Me
End If
If Text1.Text = "sa" And Text2.Text = "sa" Then
MsgBox "welcome to this system"
Unload Me
Form2.Show
End If