欢迎访问我的博客 https://javascript.shop

.NET结束外部进程 C#结束外部进程

原文发布时间为:2011-02-15 —— 来源于本人的百度文章 [由搬家工具导入]

using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            foreach (System.Diagnostics.Process thisproc in System.Diagnostics.Process.GetProcesses())
            {
                // Console.WriteLine(thisproc.ProcessName);
                if (thisproc.ProcessName.ToLower().Equals("explorer"))
                {
                    thisproc.Kill();
                    Console.WriteLine("结束进程中....");
                }
            }
        }
    }
}

posted @ 2017-07-14 00:52  孑孓子  阅读(209)  评论(0编辑  收藏  举报
欢迎访问我的博客 https://javascript.shop