o___o___o 发表于 2008-5-26 08:16

VB为什么这么难?》

下面全部勾选后 点击Command1 后 怎么才能 让 1.EXE 运行结束后 在运行2.exe 以次类推

请把 代码写全了 我是新手 写好了 给你加分

Private Sub Command1_Click()
If Check1.Value = 1 Then
Shell ("C:\1.exe") '路径
End If
If Check2.Value = 1 Then
Shell ("C:\2.exe") '路径
End If
If Check3.Value = 1 Then
Shell ("C:\3.exe") '路径
End If
If Check4.Value = 1 Then
Shell ("C:\4.exe") '路径
End If
If Check5.Value = 1 Then
Shell ("C:\5.exe") '路径
End If
If Check6.Value = 1 Then
Shell ("C:\6.exe") '路径
End If
If Check7.Value = 1 Then
Shell ("C:\7") '路径
End If
If Check8.Value = 1 Then
Shell ("C:\8") '路径
End If
End Sub

xiaolaba3330 发表于 2008-5-26 11:27

o(∩_∩)o...不难,别着急,慢慢来~~~~~

lzn3303768 发表于 2008-5-26 12:53

在form_unload事件里面加shell命令

hack214 发表于 2008-5-26 20:38

开启一个进程后!判断该进程是否结束,若已经结束,再启动第二个进程。楼主应该了解一下vb进程遍历的知识。!!!!!

multiple1902 发表于 2008-5-26 20:54

提供一段查询进程的代码,需要能够理解对象、Windows对象和简单的SELECT语句,当然也要了解VB的基本语法:)

原先是用于进行进程守护[code]Public Sub Protect()
'双进程保护模式
While 1 = 1
  Dim objWMIService, colprocesslist
   Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
   Set colprocesslist = objWMIService.ExecQuery("SELECT * FROM Win32_Process where name='" & App.EXEName & ".exe'")
   If colprocesslist.Count < 2 Then Shell AppPath & App.EXEName & ".exe"
   Sleep Config.ProtectPause '防止CPU占用过高
   DoEvents
Wend
End Sub[/code]

页: [1]

编程论坛