用VB中得shell打开D盘中的某个程序,看看语句有什么毛病
作用是*小时*分钟后运行D盘中的WinRAR.exePrivateSubCommand1_Click()IfText1.Text=""AndText2.Text=""Th...
作用是*小时*分钟后运行D盘中的WinRAR.exe
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("请输入时间")
Else
Shell ("D:\Program Files\WinRAR\WinRAR.exe") & Val(Text1.Text) * 3600 + Val(Text2.Text) * 60
MsgBox ("你的电脑执行了定时程序")
Text1.Enabled = False
Text2.Enabled = False
End If
End Sub 展开
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("请输入时间")
Else
Shell ("D:\Program Files\WinRAR\WinRAR.exe") & Val(Text1.Text) * 3600 + Val(Text2.Text) * 60
MsgBox ("你的电脑执行了定时程序")
Text1.Enabled = False
Text2.Enabled = False
End If
End Sub 展开
4个回答
展开全部
Dim i As Long, j As Long
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("请输入时间")
Else
j = Val(Text1.Text) * 3600 + Val(Text2.Text) * 60
Timer1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
MsgBox ("你的电脑执行了定时程序")
End If
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i >= j Then
i = 0
Timer1.Enabled = False
Text1.Enabled = True
Text2.Enabled = True
Shell ("D:\Program Files\WinRAR\WinRAR.exe")
End If
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000
End Sub
Private Sub Command1_Click()
If Text1.Text = "" And Text2.Text = "" Then
MsgBox ("请输入时间")
Else
j = Val(Text1.Text) * 3600 + Val(Text2.Text) * 60
Timer1.Enabled = True
Text1.Enabled = False
Text2.Enabled = False
MsgBox ("你的电脑执行了定时程序")
End If
End Sub
Private Sub Timer1_Timer()
i = i + 1
If i >= j Then
i = 0
Timer1.Enabled = False
Text1.Enabled = True
Text2.Enabled = True
Shell ("D:\Program Files\WinRAR\WinRAR.exe")
End If
End Sub
展开全部
& Val(Text1.Text) * 3600 + Val(Text2.Text) * 60 问题出在这句上
建议用个时间控件来执行
建议用个时间控件来执行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用个Timer控件啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询