2个回答
展开全部
这是简单版的,只加一个timer控件,如果想要控件完善版的随后发你邮箱吧,呵呵
Public a
Public b
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
Public a
Public b
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询