VB编写的定时关机程序的源代码是怎么样的?
VB做定时关机程序的源代码怎样的添加一个command、一个textbox一个时间控件。timer1.代码如下:PrivateSubCommand1_Click()Text1.Text=Text1.Text-1IfText1.Text="0"ThenCommand2.Enabled=TrueCommand1.Enabled=FalseText1.Enabled=FalseShell"cmd.exe/cshutdown.exe-s-t0",vbHideEndIfEndSubPrivateSubCommand
VB做定时关机程序的源代码怎样的
添加一个command 、一个 textbox 一个时间控件 。
timer1.
代码如下:Private Sub Command1_Click()
Text1.Text = Text1.Text - 1
If Text1.Text = "0" Then
Command2.Enabled = True
Command1.Enabled = False
Text1.Enabled = False
Shell "cmd.exe /c shutdown.exe -s -t 0", vbHide
End If
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
Text1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
Command2.Enabled = False
End Sub
我还帮你实现了停止计时呢~~~ 程序界面大概这样
你复制代码进去就可以用了。。 如果你想要实现更多的功能的话,就加我QQ:554997416
VB编程解这是VB编的一个倒计时关机程序怎样使 x为用户自己输入
一分钟关机代码,你试下,我不试我不想关机
Dim tim As Integer
Private Sub Timer1_Timer() If tim >= 60 Then Shell "cmd.exe /c shutdown -s -t 0 " End If tim = tim + 1 End Sub
你迟迟不肯采纳,是不是要和你一样的代码
Dim x As Integer Private Sub Command1_Click() x = Val(InputBox("输入倒计时关机时间", "", "")) Shell "cmd.exe /c shutdown -s -t " & x End Sub
Private Sub Command2_Click() Shell "cmd.exe /c shutdown -a" End Sub
如何使用VB写关机小程序
帮你写了段代码
Private Sub Command1_Click()
If Text1 = "我是猪" Then
Shell "cmd.exe /c shutdown -a"
MsgBox "哈哈放过你吧!", 64, "提示"
End
End If
End Sub
Private Sub Form_Load()
MsgBox "哈哈你中招了、快说你是猪,否则1分钟就让你电脑关机", 48, "提示"
Shell "cmd.exe /c shutdown -s -t " & 60, vbHide
End Sub
Private Sub Form_Unload(Cancel As Integer)
g = MsgBox("想关掉我???", vbOKCancel + vbQuestion, "关闭窗口")
If g = vbOK Then
Cancel = 11
MsgBox "哈哈你关不掉我的快说我是猪吧", 64, "提示"
End If
If g = 2 Then
Cancel = 11
End If
End Sub
vb编个定时关机的
Private Sub Command1_Click()
If Val(Text1.Text) > 0 And Val(Text2.Text) > 0 And Val(Text3.Text) > 0 And Val(Text4.Text) > 0 And Val(Text5.Text) > 0 Then
Timer1.Enabled = True
Else
MsgBox "请输入时间"
End If
End Sub
Private Sub Form_Load()
Text1.Text = Year(Now)
Text2.Text = Month(Now)
Text3.Text = Day(Now)
Text4.Text = Hour(Now)
Text5.Text = Minute(Now)
Command1.Caption = "开始倒计时"
Timer1.Interval = 1000
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Me.Caption = Format(Now, "YYYY-MM-DD HH:MM")
If Me.Caption = Text1 & "-" & Format(Text2, "00") & "-" & Format(Text3, "00") & " " & Format(Text4, "00") & ":" & Format(Text5, "00") Then Shell ("c:\windows\system32\shutdown.exe /s /t 0"): Timer1.Enabled = False
End Sub
Windows 10 是一款微软推出的经典操作系统,拥有硬件兼容性与多任务处理能力。它更偏向把系统状态查看和常用调节动作放在一起,适合需要持续观察和微调设备状态的场景。
极度公式是一款跨平台专业LaTeX公式识别编辑软件,支持OCR公式识别和多平台编辑。和使用说明,避免使用,享受完整功能与稳定支持。做扫描整理、文字提取和表格转换时,它能把识别后的处理步骤接得更顺,资料录入这类场景会省下不少时间。
















