VB编程问题4

来源:百度知道 编辑:UC知道 时间:2024/06/23 06:05:39
Private Sub Timer2_Timer()

Dim a, b, c, d, e, f, g, h, i '麻烦啊

a = #9:20:00 AM#
Label1.Caption = Time
If Label1.Caption = a Then
Shell "zhu.exe"
End If

b = #11:20:00 AM#
Label1.Caption = Time
If Label1.Caption = b Then
Shell "zhu.exe"
End If

c = #1:20:00 PM#
Label1.Caption = Time
If Label1.Caption = c Then
Shell "zhu.exe"
End If

d = #2:20:00 PM#
Label1.Caption = Time
If Label1.Caption = d Then
Shell "zhu.exe"
End If

e = #4:20:00 AM#
Label1.Caption = Time
If Label1.Caption = e Then
Shell "zhu.exe"
End If

f = #6:20:00 AM#
Label1.Caption = Time
If Label1.Caption = f Then
Shell "zhu.exe"
End If

g = #8:20:00 AM#
Label1.Caption = Time
If Label1.Caption = g Then
Shell "zhu.exe"
End If

Dim t(1 To 9) As Date, i As Long
Private Sub Form_Load()

t(1) = #4:20:00 AM#

For i = 2 To 3
t(i) = t(i - 1) + #2:00:00 AM#
Next

t(4) = #9:00:00 AM#
For i = 5 To 9
t(i) = t(i - 1) + #1:00:00 AM#
Next
End Sub

Private Sub Timer2_Timer()
Label1.Caption = Time
For i = 1 To 9
If Label1.Caption = t(i) Then Shell "zhu.exe": Exit For
Next
End Sub