VB6 使用Timer延时执行语句问题
PrivateSubExBtn3_Click()DimaAsStringa=InputBox("请输入您要映射的UNC路径"&vbCrLf&"输入格式:\\目标IP\共享...
Private Sub ExBtn3_Click()
Dim a As String
a = InputBox("请输入您要映射的UNC路径" & vbCrLf & "输入格式:\\目标IP\共享名", "输入信息", "", 7000, 5000)
Shell "cmd /c net use X: " & " " & a, vbHide
End Sub
我想让上面的语句执行完毕后让timer1延时两秒执行
注:一定要是在触发了以上的单击事件之后执行延时语句里面的语句
Shell "cmd /c fsutil fsinfo drives > C:\Tmp\disk.txt ", vbHide" 展开
Dim a As String
a = InputBox("请输入您要映射的UNC路径" & vbCrLf & "输入格式:\\目标IP\共享名", "输入信息", "", 7000, 5000)
Shell "cmd /c net use X: " & " " & a, vbHide
End Sub
我想让上面的语句执行完毕后让timer1延时两秒执行
注:一定要是在触发了以上的单击事件之后执行延时语句里面的语句
Shell "cmd /c fsutil fsinfo drives > C:\Tmp\disk.txt ", vbHide" 展开
展开全部
你就把shell语句放到timer事件过程中
Private Sub ExBtn3_Click()
Dim a As String
a = InputBox("请输入您要映射的UNC路径" & vbCrLf & "输入格式:\\目标IP\共享名", "输入信息", "", 7000, 5000)
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
static i as long
i=i+1
if i>2 then Shell "cmd /c net use X: " & " " & a, vbHide:Timer1.Enabled = false
end sub
Private Sub ExBtn3_Click()
Dim a As String
a = InputBox("请输入您要映射的UNC路径" & vbCrLf & "输入格式:\\目标IP\共享名", "输入信息", "", 7000, 5000)
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
static i as long
i=i+1
if i>2 then Shell "cmd /c net use X: " & " " & a, vbHide:Timer1.Enabled = false
end sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询