【发布时间】:2013-10-22 09:33:02
【问题描述】:
我运行多个命令行进程,以循环方式启动它们。它可以工作并异步启动所有这些。
Public Sub DoWork
Dim i As Integer = 0
While (Args_reader.Peek() > -1)
i = i + 1
MyArg = Args_reader.ReadLine
Dim MyArg As String
Dim MyProcess(i) As Process
MyProcess(i) = New Process
With MyProcess(i).StartInfo
.FileName = MyFile
.Arguments = MyArg
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardInput = True
.RedirectStandardOutput = True
.RedirectStandardError = True
.WindowStyle = ProcessWindowStyle.Hidden
End With
MyProcess(i).Start()
End While
Args_reader.Close()
i = 0
End Sub
我可以读取所有它们的 stdOutput 并检查它们的状态吗? 我需要等到他们完成才能继续执行程序。
【问题讨论】:
标签: vb.net asynchronous process stdout