我正在使用 Process 运行一个批处理文件。问题是我希望批处理文件完成执行,然后执行下一组行。 这是代码片段。
Process proc = new Process();
proc.StartInfo.FileName = AppDomain.CurrentDomain.BaseDirectory + sFileName+".bat";
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
proc.Start();
Thread.Sleep(1000);
// Method which will be executed after the batch file
Method1();
Method1() 应该只在批处理文件完成执行时执行。
有人可以帮忙吗?
最佳答案
关于c# - 暂停执行直到批处理文件完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30023062/