wait for processes [closed]
I want to wait for a process to close to perform some action how can I do that?
5 Replies
Is this a process you started in c# or a random running process
Process.WaitForExit Method (System.Diagnostics)
Sets the period of time to wait for the associated process to exit, and blocks the current thread of execution until the time has elapsed or the process has exited. To avoid blocking the current thread, use the Exited event. For code examples, see the StandardError and the ExitCode property reference pages.
a process that I started
Then use
process.waitForExit
. You can also find a process by PID or nameok thanks