等待过程完成,然后显示消息(C#) [英] Wait for process to finish and then display message (C#)

查看:82
本文介绍了等待过程完成,然后显示消息(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够看到一个进程,直到它终止,并且一旦不存在显示一条消息,该如何实现?

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?

推荐答案

创建/附加到进程,然后使用 WaitForExit()阻止直到退出,或者使用 OnExited 事件,如果您不希望应用在等待应用退出时被阻止。

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.

我衷心建议您查看流程-正确这里

这篇关于等待过程完成,然后显示消息(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆