如上所说~~
这个是他的代码:
Private Sub Command1_Click()
Shell "shutdown -l" '-l 是shutdown 的一个参数 意思是注销用户
End Sub
Private Sub Command2_Click()
Shell "shutdown -R -t 0" '-r 是重启 等待时间为0秒
End Sub
Private Sub Command3_Click()
Shell "shutdown -S -t 0" '-s 是关闭系统
End Sub
Private Sub Command4_Click()
frmAbout.Show
End Sub
Private Sub Command5_Click()
If Text2.Text = "" Or Text3.Text = "" Then
Text1.Text = "你忘了输入定时时间罗!!"
ElseIf Text2 > 23 Or Text3 > 59 Then
MsgBox "请输入所规定的时间范围!!", 0 + 16 + 0, "输入错误!"
Text1.Text = "输入错误,请重新输入!"
Text2.Text = ""
Text3.Text = ""
Else
a = Val(Text2.Text)
b = Val(Text3.Text)
Text1.Text = "你要关机的时间是" & a & "时" & b & "分"
Text2.Text = ""
Text3.Text = ""
End If
End Sub
Private Sub Command6_Click()
End
End Sub
Private Sub Form_Load()
Command5.Value = True
Text1.Text = "L1IOU专用版"
Timer1.Interval = 1000
End Sub
Private Sub Text1_Change()
Text1.Locked = True
End Sub
Private Sub Text2_Change()
Text2.MaxLength = 2
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then Exit Sub
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "你看过 ^小时^ 不是数字的吗??", 0 + 16 + 0, "^小时^输入错误!"
End If
End Sub
Private Sub Text3_Change()
Text3.MaxLength = 2
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then Exit Sub
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
MsgBox "你看过 ^分钟^ 不是数字的吗??", 0 + 16 + 0, "^分钟^输入错误!"
End If
End Sub
Private Sub Timer1_Timer()
Me.Cls
Label2.Caption = "@" & 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
如果不清楚我把附件上传来了~~我想问一下我错在哪了~其他功能可以可是为什么定时关不了机~~