如何在C#中使用Windows窗体杀死应用程序? [英] How to kill an application using windows forms in C#?

查看:67
本文介绍了如何在C#中使用Windows窗体杀死应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用任务管理器我们可以杀死一个应用程序。我想在不使用任务管理器的情况下终止应用程序。没有关闭或退出。



我尝试过:



我尝试了一些东西来获取任务管理器选项,但我无法做到

Using Task Manager we can kill an application. I want to kill an application without using Task Manager. Not closing or exit.

What I have tried:

I have tried something to get the Task Manager options but I am not able to do

推荐答案

试试这个。

Try this.
foreach (Process Proc in Process.GetProcesses())
     if (Proc.ProcessName.Equals("EXCEL"))  //Process Excel?
          Proc.Kill();





如需更多信息,请点击以下链接...

在任务管理器中杀死进程 [ ^ ]

使用C#按名称和用户名进行处理? [ ^ ]

在任务管理器中终止进程 [ ^ ]



问候,

AARIF SHAIKH



For More please follow below links...
kill in process in task manager[^]
kill process by name and user name using C#?[^]
kill process in task manager[^]

Regards,
AARIF SHAIKH


这篇关于如何在C#中使用Windows窗体杀死应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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