我想你正试图在这里做的是叫做:多线程,我的想法是,你可以创建启动4个线程的应用程序,你开始他们都在一起,这是类似的东西:
using System.Threading;
{
class Program
{
static void Main(string[] args)
{
//Here is your main program :
//Initiate the thread (tell it what to do)
ThreadStart testThreadStart = new ThreadStart(new Program().testThread);
//Create 4 Threads and give the Path of the 4 CSV files to process
Thread Thread1 = new Thread(() => testThreadStart(PathOfThe1stCSVFile));
Thread Thread2 = new Thread(() => testThreadStart(PathOfThe2ndCSVFile));
Thread Thread3 = new Thread(() => testThreadStart(PathOfThe3rdCSVFile));
Thread Thread4 = new Thread(() => testThreadStart(PathOfThe4thCSVFile));
//Start All The Threads Together
testThread1.Start();
testThread2.Start();
testThread3.Start();
testThread4.Start();
//All The Threads are finished
Console.ReadLine();
}
public void testThread(String CSVfilePathToProcess)
{
//executing in thread
//put the : Process.Start(@"XYZ.exe", input arguments). here !!!
//and put the CSVfilePathToProcess as arguments
}
}
}
编辑:如果多线程对你而言并不复杂,你也可以使用backgroundworker in C#,但这个想法是一样的。
[Process.Start(string,string)](http://msdn.microsoft.com/zh-cn/library/h6ak8zt5(v = vs.110).aspx)的备注部分说:“如果进程已经运行,则不会启动其他进程。“您可能希望使用[this overload](http://msdn.microsoft.com/en-us/library/0w4h05yb(v = vs.110).aspx)。 – 2014-10-18 03:12:10
[这个答案也许对你有用。](http://stackoverflow.com/questions/10788982/is-there-any-async-equivalent-of-process-start) – WhoIsRich 2014-10-18 03:15:01
我编辑过你的标题。请参阅:“[应该在其标题中包含”标签“](http://meta.stackexchange.com/questions/19190/)”,其中的共识是“不,他们不应该”。 – 2014-10-20 20:16:34