如何使用示例自动杀死explorer.exe? [英] how can i kill a explore.exe automatically by using a sample?

查看:126
本文介绍了如何使用示例自动杀死explorer.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用.net c#通过示例自动杀死任务管理器中的explorer.exe.c#

hi i want to kill the explore.exe in the task manager automatically through a sample using .net c#

推荐答案

foreach(Process p in Process.GetProcesses())
{
    try
    {
        //compare it with "explorer "
        if (p.MainModule.ModuleName.Contains("explorer") == true)
            p.Kill();
    }
    catch (Exception e)
    {
        //do some exception handling here
    }
    //restart explorer
    Process.Start("explorer.exe");
}



[纠正的错误代码样式]



[Corrected bad code style]


这篇关于如何使用示例自动杀死explorer.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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