VB6事实错误 要求对象,无效的过程调用或参数
PrivateSubCommand1_Click()DimunameAsString,psdAsString,vcodeAsIntegeruname=Text1.Text...
Private Sub Command1_Click()
Dim uname As String, psd As String, vcode As Integer
uname = Text1.Text
psd = Text2.Text
vcode = Val(Text3.Text)
If vcode <> Val(Label4.Caption) Then
Label5.Caption = "验证码错误"
ElseIf uname <> "1292460054" Or psd <> "521" Then
Label5.Caption = "用户名或密码错误"
Else
Label5.Caption = "验证成功!"
Imagel.Visible = Ture
Tier1.Interval = 200
End If
If num < 1 Then
MsgBox ("3次机会已到,程序结束!") '弹出一个对话框
End '终止程序
End If
End Sub
Private Sub Form_Load()
Randomize
Label4.Caption = Int(Rnd * 9000) + 1000
num = 3 '有3次登陆机会
t = 60 '60秒倒计时
Timer2.Interval = 1000
End Sub
Private Sub T_Change()
End Sub
Private Sub Timer1_Timer()
Dim n As Integer, ss As String
ss = Label5.Caption
n = Len(ss)
Label5.Caption = Mid(ss, 2, n - 1) + Mid(ss, 1, 1)
End Sub
Private Sub Timer2_Timer()
Label6.Caption = "还剩余" & Str(t) & "秒"
t = t - 1
If t < 0 Then
MsgBox ("时间打,程序结束")
End
End If
End Sub 展开
Dim uname As String, psd As String, vcode As Integer
uname = Text1.Text
psd = Text2.Text
vcode = Val(Text3.Text)
If vcode <> Val(Label4.Caption) Then
Label5.Caption = "验证码错误"
ElseIf uname <> "1292460054" Or psd <> "521" Then
Label5.Caption = "用户名或密码错误"
Else
Label5.Caption = "验证成功!"
Imagel.Visible = Ture
Tier1.Interval = 200
End If
If num < 1 Then
MsgBox ("3次机会已到,程序结束!") '弹出一个对话框
End '终止程序
End If
End Sub
Private Sub Form_Load()
Randomize
Label4.Caption = Int(Rnd * 9000) + 1000
num = 3 '有3次登陆机会
t = 60 '60秒倒计时
Timer2.Interval = 1000
End Sub
Private Sub T_Change()
End Sub
Private Sub Timer1_Timer()
Dim n As Integer, ss As String
ss = Label5.Caption
n = Len(ss)
Label5.Caption = Mid(ss, 2, n - 1) + Mid(ss, 1, 1)
End Sub
Private Sub Timer2_Timer()
Label6.Caption = "还剩余" & Str(t) & "秒"
t = t - 1
If t < 0 Then
MsgBox ("时间打,程序结束")
End
End If
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询