PrivateSubcmdOK_Click()
StaticinterrAsInteger
DimsuserAsString
DimspassAsString
suser=UCase$(Trim$(txtUser.Text))
spass=Trim$(txtPassword.Text)
Ifsuser="ADMIN"Andspass="123456"Then
frmMain.Show
UnloadMe
Else
interr=interr+1
Ifinterr>3Then
MsgBox"对不起,您不是本系统的合法用户。",vbInformation,"提示"
End
Else
MsgBox"用户名或密码错误,请重新输入",vbExclamation,"提示"
Ifsuser<>"ADMIN"Then
txtUser.SelStart=0
txtUser.SelLength=Len(txtUser.Text)
txtUser.SetFocus
Else
txtPassword.SelStart=0
txtPassword.SelLength=Len(txtPassword.Text)
txtPassword.SetFocus
EndIf
EndIf
EndIf
EndSub
PrivateSubCommand2_Click()
End
EndSub