自己用VB编写的定时关机软件代码,欢迎大家交流

来源:互联网 发布:91熊猫看书软件 编辑:程序博客网 时间:2024/06/06 01:47
Private Sub Command1_Click()
Timer1.Interval = 1000
Combo1.Enabled = False
Combo2.Enabled = False
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Combo1.Enabled = True
Combo2.Enabled = True
End Sub
Private Sub Command3_Click()
Form1.Visible = False
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Combo1.List(0) = 0
Combo1.List(1) = 1
Combo1.List(2) = 2
Combo1.List(3) = 3
Combo1.List(4) = 4
Combo1.List(5) = 5
Combo1.List(6) = 6
Combo1.List(7) = 7
Combo1.List(8) = 8
Combo1.List(9) = 9
Combo1.List(10) = 10
Combo1.List(11) = 11
Combo1.List(12) = 12
Combo1.List(13) = 13
Combo1.List(14) = 14
Combo1.List(15) = 15
Combo1.List(16) = 16
Combo1.List(17) = 17
Combo1.List(18) = 18
Combo1.List(19) = 19
Combo1.List(20) = 20
Combo1.List(21) = 21
Combo1.List(22) = 22
Combo1.List(23) = 23
Combo2.List(0) = 0
Combo2.List(1) = 1
Combo2.List(2) = 2
Combo2.List(3) = 3
Combo2.List(4) = 4
Combo2.List(5) = 5
Combo2.List(6) = 6
Combo2.List(7) = 7
Combo2.List(8) = 8
Combo2.List(9) = 9
Combo2.List(10) = 10
Combo2.List(11) = 11
Combo2.List(12) = 12
Combo2.List(13) = 13
Combo2.List(14) = 14
Combo2.List(15) = 15
Combo2.List(16) = 16
Combo2.List(17) = 17
Combo2.List(18) = 18
Combo2.List(19) = 19
Combo2.List(20) = 20
Combo2.List(21) = 21
Combo2.List(22) = 22
Combo2.List(23) = 23
Combo2.List(24) = 24
Combo2.List(25) = 25
Combo2.List(26) = 26
Combo2.List(27) = 27
Combo2.List(28) = 28
Combo2.List(29) = 29
Combo2.List(30) = 30
Combo2.List(31) = 31
Combo2.List(32) = 32
Combo2.List(33) = 33
Combo2.List(34) = 34
Combo2.List(35) = 35
Combo2.List(36) = 36
Combo2.List(37) = 37
Combo2.List(38) = 38
Combo2.List(39) = 39
Combo2.List(40) = 40
Combo2.List(41) = 41
Combo2.List(42) = 42
Combo2.List(43) = 43
Combo2.List(44) = 44
Combo2.List(45) = 45
Combo2.List(46) = 46
Combo2.List(47) = 47
Combo2.List(48) = 48
Combo2.List(49) = 49
Combo2.List(50) = 50
Combo2.List(51) = 51
Combo2.List(52) = 52
Combo2.List(53) = 53
Combo2.List(54) = 54
Combo2.List(55) = 55
Combo2.List(56) = 56
Combo2.List(57) = 57
Combo2.List(58) = 58
Combo2.List(59) = 59
Timer2.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Me.Cls
If Hour(Time) = Combo1.Text And Minute(Time) = Combo2.Text Then
Timer1.Enabled = False
Shell "C:\WINDOWS\system32\shutdown.exe -s -t 10"
End If
End Sub
Private Sub Timer2_Timer()
Label5.Caption = "现在是北京时间:" & Time
End Sub
原创粉丝点击