📄 autoshutdown.frm
字号:
VERSION 5.00
Begin VB.Form AutoShutDown
Caption = "AutoShutDown"
ClientHeight = 2805
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
Icon = "AUTOSH~1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2805
ScaleWidth = 4680
StartUpPosition = 1 'CenterOwner
Begin VB.Timer Timer2
Left = 4080
Top = 2640
End
Begin VB.TextBox Text5
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1680
TabIndex = 5
Text = "00:00"
Top = 1440
Width = 735
End
Begin VB.TextBox Text4
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2400
Locked = -1 'True
TabIndex = 4
Text = "SS"
Top = 840
Width = 495
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 1680
Locked = -1 'True
TabIndex = 3
Text = "HH:MM"
Top = 840
Width = 735
End
Begin VB.Timer Timer1
Left = 3600
Top = 2640
End
Begin VB.TextBox Text1
Enabled = 0 'False
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 2400
Locked = -1 'True
TabIndex = 2
Top = 120
Width = 2175
End
Begin VB.CommandButton Command2
Caption = "Stop N Exit"
BeginProperty Font
Name = "Georgia"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 1
Top = 1920
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Start"
BeginProperty Font
Name = "Georgia"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 720
TabIndex = 0
Top = 1920
Width = 975
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "HH:MM :SS"
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000D&
Height = 210
Left = 1680
TabIndex = 8
Top = 600
Width = 1110
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "Shut Down Time"
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 120
TabIndex = 7
Top = 1440
Width = 1440
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Present Time"
BeginProperty Font
Name = "Georgia"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 120
TabIndex = 6
Top = 840
Width = 1140
End
End
Attribute VB_Name = "AutoShutDown"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SDT, PT As String
Dim result As Integer
Private Sub Command1_Click()
SDT = FormatDateTime(Text5.Text, vbShortTime)
PT = FormatDateTime(Text1.Text, vbShortTime)
result = StrComp(SDT, PT)
If result = 0 Then
Shell "shutdown -s -t 01"
End If
Timer2.Interval = 1000
Timer2.Enabled = True
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Text1.Text = Now
Timer1.Interval = 1000
Timer1.Enabled = True
Text3.Text = Format(Time, "HH:MM")
Text4.Text = Format(Time, "SS")
End Sub
Private Sub Timer1_Timer()
Text1.Text = Now
Text3.Text = Format(Time, "HH:MM")
Text4.Text = Format(Time, "SS")
End Sub
Private Sub Timer2_Timer()
SDT = FormatDateTime(Text5.Text, vbShortTime)
PT = FormatDateTime(Text1.Text, vbShortTime)
result = StrComp(SDT, PT)
If result = 0 Then
Shell "shutdown -s -t 01"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -