我在C#中使用此代码
System.Diagnostics.Process.Start(“CMD.exe”,@”/C cd\ & mySecondCommandHere“);
它可以正常工作,但是不知道何时完成。
当dos推荐完成时,我如何获得代码来提醒我?
一种方法是调用WaitForExit。这将阻止执行,直到相关进程退出。
var process = System.Diagnostics.Process.Start("...");
//The next line will block until the process has finished
process.WaitForExit();
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句