循环调用外部命令的问题
测试时文件数量少没发现问题,用的时候由于处理上百万的文件,进程后来非常多,而且到最后提示无法调用的exe,请问有什么好的解决办法
C# Process
foreach (FileInfo NextFile in fileInfo)
{
runOne();
}
private void runOne()
{
string binStr = "a.exe";
string argu = " -0"
Process exep = new Process();
exep.StartInfo.FileName = binStr;
exep.StartInfo.Arguments = argu;
exep.StartInfo.CreateNoWindow = true;
exep.StartInfo.UseShellExecute = false;
exep.Start();
}