How to wait for a console process to complete BEFORE running the other console process in wpf applications?

后端 未结 1 1339
南旧
南旧 2021-01-13 23:52

I have 2 external process to run(2 console exe) that provide output to console. I am running these apps on wpf application. I capture console output and use it as input.

相关标签:
1条回答
  • 2021-01-14 00:19

    Assuming you are using Process class to execute and capture output for console, you can use Process.WaitForExit method. It will block the current thread till the process finish the execution. There is another overload that can block the current thread till the process finishes or specified timeout period elapsed.

    0 讨论(0)
提交回复
热议问题