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

查看:29
本文介绍了等待进程完成,然后显示消息 (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.

我衷心建议您查看 Process 的文档 - 就在这里

I heartily recommend reviewing the documentation for Process - right here

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

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