定時關機源代碼,望大家發表一下關機的API函數 指教
Private Sub Command1_Click()Text1.Text = Format(Text1.Text, "hh:mm:ss")
If Text1.Text = "00:00:00" Or Text1.Text = "" Then
If MsgBox("日期格式錯誤,將為當前時間是否執行", vbYesNo + vbQuestion, "關機") = vbYes Then
Text1.Text = Format(Time, "hh:mm:ss")
Else
Exit Sub
End If
Else
Label1.Caption = Text1.Text
End If
Timer1.Enabled = True
Call Timer1_Timer
Command1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Format(Time, "hh:mm:ss")
If Label1.Caption = Format(Text1.Text, "hh:mm:ss") Then
Shell "shutdown -s"
End If
End Sub