判断口令题,关键是一些循环语句及选择结构的综合应用

来源:百度文库 编辑:神马文学网 时间:2024/04/29 15:21:48
判断口令题,关键是一些循环语句及选择结构的综合应用2006-10-03 18:20

Private Sub C1_Click()

    If Text1.Text = "123456" Then

        Text1.Text = "口令正确"

        Text1.PasswordChar = ""

    Else

        Text2.Text = Text2.Text - 1

        If Text2.Text > 0 Then

            MsgBox "" & (3 - Text2.Text) & "次口令错误,请重新输入"

        Else

            MsgBox "3次输入错误,请退出"

            Text1.Enabled = False

        End If

    End If

End Sub