C# 暂停/停止 System.Diagnostics.Process
我有一个运行 exe 的进程:
Process pr = new Process();
pr.StartInfo.FileName = @"wput.exe";
等
我希望能够暂停和停止此进程。我可以发起什么活动来实现这一目标吗?我的应用程序中有多个进程在工作,每个进程都有自己的线程。我查看了暂停线程,但这不会给我想要的结果。
I have a Process that runs an exe:
Process pr = new Process();
pr.StartInfo.FileName = @"wput.exe";
etc
I want to be able to pause and stop this Process. Are there any events I can raise to achieve this. I have multiple Processes working in my app, each with it's own Thread. I looked at pausing Threads but that would not give me the result I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以像任务管理器一样读取系统中的进程列表,并尝试终止名为“wput.exe”的进程。
试试这个
You could read the list of processes in the system, as task manager does and try to kill the process with the name "wput.exe".
Try this
要杀死刚刚启动的进程,请使用:
To kill just started process use: