Option Explicit Private a As Single Private Sub Command1_Click() a = a + 1 If a > 3 Then End End If If Text1.Text = "123" Then If Text2.Text = "456" Then MsgBox "登陆成功!", vbInformation Else MsgBox "登录失败!重新登录!", vbCritical End If End If End Sub Private Sub Command2_Click() Dim b As Single b = InputBox(" 请输入密码:") If b = "456" Then End Else MsgBox "密码错误!", vbCritical End If End Sub