新手请指教,vb简单定时关机代码,哪里错了

hjuhj110 2013-04-21 09:57:13
Option Explicit
Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1.Enabled = True Else
Text1.Enabled = False
End If
End Sub
Private Sub Command1_Click()
If Text1.Enabled = True Then
Shell "shutdown-S -t" & Text1.Text
Else
Shell "shutdown-S -t3"
End If
End Sub
Private Sub Command2_Click()
If Text1.Enabled = True Then
Shell "shutdown-R -t" & Text1.Text
Else
Shell "shutdown-R -t3"
End If
End Sub
Private Sub Command3_Click()
End
End Sub

界面如图,哪里错了求详细指导,谢谢
...全文
139 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
threenewbee 2013-04-22
  • 打赏
  • 举报
回复
引用 2 楼 worldy 的回复:
Shell "shutdown-S -t " & Text1.Text
不好意思,是要空格的。
hjuhj110 2013-04-22
  • 打赏
  • 举报
回复
引用 3 楼 caozhy 的回复:
引用 2 楼 worldy 的回复:Shell "shutdown-S -t " & Text1.Text -t后面不要空格哦。
综合你们两得一起才有用,-t后不加空格没有反应,还有要配合界面上的分钟计时,是不是改成这个Shell "shutdown-S -t" & val(Text1.Text)*60
threenewbee 2013-04-21
  • 打赏
  • 举报
回复
引用 2 楼 worldy 的回复:
Shell "shutdown-S -t " & Text1.Text
-t后面不要空格哦。
worldy 2013-04-21
  • 打赏
  • 举报
回复
Shell "shutdown-S -t   " & Text1.Text 
threenewbee 2013-04-21
  • 打赏
  • 举报
回复
"shutdown -S -t" & Text1.Text

加一个空格在shutdown后面看看。

7,764

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧