Wait for process to finish and then display message (C#)

前端 未结 3 1658
梦毁少年i
梦毁少年i 2020-12-11 19:57

I would like to be able to watch a process until it is terminated, and once non existent display a message, how could this be achieved?

3条回答
  •  不知归路
    2020-12-11 20:09

    Create/Attach to the process and then either use WaitForExit() to block until it has exited, or use the OnExited Event if you don't wish your application to block while it's waiting for the app to exit.

    I heartily recommend reviewing the documentation for Process - right here

提交回复
热议问题