真的就没有高手吗? if text1.text="admin" and text2.text="admin" then MsgBox "登陆成功" else MsgBox "用户名或密码错误" end if 但是密码只能错3次怎么编写
你看你用IF 语句做个<3的约束呢? 应该可以吧 错了就+1 当=3就 用户名错误 然后关闭EXE
Private Sub Command1_Click() Static iEnterCount As Integer If LCase(Trim(Text1)) = "admin" And LCase(Trim(Text2)) = "admin" Then iEnterCount = 0 MsgBox "登陆成功!" Else If iEnterCount >= MAX_ENTER Then MsgBox "输入错误次数已达三次或以上,程序自动退出。" End End If MsgBox "用户名或密码错误!" iEnterCount = iEnterCount + 1 End If End Sub以上是这论坛里的,你没找到吧
if text1.text="admin" and text2.text="admin" then
MsgBox "登陆成功"
else
MsgBox "用户名或密码错误"
end if 但是密码只能错3次怎么编写
Static iEnterCount As Integer
If LCase(Trim(Text1)) = "admin" And LCase(Trim(Text2)) = "admin" Then
iEnterCount = 0
MsgBox "登陆成功!"
Else
If iEnterCount >= MAX_ENTER Then
MsgBox "输入错误次数已达三次或以上,程序自动退出。"
End
End If
MsgBox "用户名或密码错误!"
iEnterCount = iEnterCount + 1
End If
End Sub以上是这论坛里的,你没找到吧