如何使用C#终止进程 [英] How to kill a process using C#

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

问题描述

所以,我正在做一些事情,我需要一种方法来杀死Roblox,使用一个按钮。有人帮帮我吗?

So, im working on something and I need a way to kill Roblox, using a button. Anyone help me out?

推荐答案

所以,我正在做一些事情,我需要一种方法来杀死Roblox,使用一个按钮。有人帮帮我吗?
So, im working on something and I need a way to kill Roblox, using a button. Anyone help me out?

你可以使用 

You can use 

            Process.GetProcessByName()  //查看文档

           Process.GetProcessByName()  // see the doc

,然后确定您的具体流程,然后致电

and then identify your specific process, and then call

            Process.CloseMainWindow()//查看文件

            Process.Close()  //查看您获得的实例上的文档

           Process.CloseMainWindow() // see the doc
           Process.Close()  // see the doc

,以便顺利关闭。

,如果你真的想要杀死,请致电,

But, if you wanna really kill it, call, instead,

            Process.Kill()  //查看文档

           Process.Kill()  // see the doc


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

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