Private Sub Form_Click()
a = InputBox("输入你想关机的时间--时(0-23)")
b = InputBox("输入你想关机的时间--分(0-59)")
Me.Caption = "你要关机的时间是" & a & "时" & b & "分"
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Me.Cls
Print "现在时间是:" & Time
If Hour(Time) = a And Minute(Time) = b Then
Timer1.Enabled = False
Shell ("c:\windows\system32\shutdown.exe /s /t 0")
End If
End Sub