VB帐号密码验证

来源:百度知道 编辑:UC知道 时间:2024/05/20 02:35:11
当帐号为VB,密码为123时,程序显示为验证通过.当帐号密码出现两次错误时,程序自动退出,请问这个程序的代码怎么编

Dim a As Integer
Private Sub Command1_Click()
If a >= 2 Then
End
End If
If Text1.Text <> "vb" Or Text2.Text <> "123" Then
MsgBox ("用户名或密码不对")
a = a + 1
Else
MsgBox ("登陆成功")
a = 0
End If
End Sub

'-----------窗口模块变量--------
dim logincount as inteter
logincount=0

'-----------按钮过程--------------------
dim uname as string
dim upass as string
uname="vb"
upass="123"
if trim(text1.text)=uname and trim(text2.text)=upass then
.......
else
if logincount<>2 then
logincount=logincount+1
else
unload me
end if
end if