VB程序编写账号和密码的验证程序

2025-03-26 12:36:19
推荐回答(1个)
回答1:

Private Sub Command1_Click()
If IsNumeric(Text1.Text) And Len(Text1.Text) = 6 And Text2.Text = "good" Then
 MsgBox "输入正确,验证通过", vbOKCancel, "验证通过"
Else
 If MsgBox("账号或密码错误", vbRetryCancel, "验证错误") = vbRetry Then
    Text1.Text = ""
    Text2.Text = ""
    Text1.SetFocus
 Else
    End
 End If
End If

End Sub

Private Sub Form_Load()
Text1.PasswordChar = "*"

End Sub