暂停C#中的进程 [英] Pause a process in C#

查看:453
本文介绍了暂停C#中的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在C#中使用System.Diagnostics.Process类.
是否可以暂停一个进程(不是我的进程,而是另一个进程),然后在此类或另一个类中继续执行?
如果可能的话,该怎么做?

预先感谢.

Hi,

I''m using the System.Diagnostics.Process class in C#.
Is it possible to pause a process (not my process, but another) and then continue it with this class or with another class?
If possible, how to do that?

Thanks in advance.

推荐答案

出于明显的原因,您无法从流程本身内部恢复已暂停的流程...

推荐的方法是使用Mutex: Mutex.WaitOne [ ^ ]-其中包括一个将在指定的毫秒数后唤醒"的版本.
For obvious reasons, you can''t resume a suspended process from within the process itself...

The recommended way would be to use a Mutex: Mutex.WaitOne[^] - this includes a version that will "wake up" after a specified number of milliseconds.


这篇关于暂停C#中的进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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