Private Sub cmdOK_Click()
If Trim(txtUser.Text) = "" Or Trim(txtPwd.Text) = "" Then
MsgBox "用户名和密码不允许为空" & Space(5), vbExclamation + vbOKOnly, "登陆失败"
txtUser.SetFocus
Exit Sub
ElseIf InStr(1, txtUser.Text, "'") > 0 Then
MsgBox "不允许输入特殊字符" & Space(5), vbExclamation + vbOKOnly, "系统提示"
txtUser.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
Else
Dim lLogin As Long
lLogin = CheckLogin(Trim(txtUser.Text), MD5(Trim(txtPwd.Text), 1))
Select Case lLogin
Case "0":
sCurUser = Trim(txtUser.Text)
Me.Hide
frmMain.Show
Unload Me
Case "1":
MsgBox "该用户不存在" & Space(5), vbInformation + vbOKOnly, "系统提示"
txtUser.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
Case "2":
MsgBox "密码错误,请重新输入" & Space(5), vbExclamation + vbOKOnly, "登陆失败"
txtPwd.SetFocus
SendKeys "{Home}+{End}"
Exit Sub
Case "3":
MsgBox "登陆失败,请重新启动程序" & Space(5), vbExclamation + vbOKOnly, "登陆失败"
Unload Me
End Select
End If
End Sub
为什么走的是
Case "3":
MsgBox "登陆失败,请重新启动程序" & Space(5), vbExclamation + vbOKOnly, "登陆失败"
Unload Me