.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("结束进程中....");
                }
            }
        }
    }
}

原文地址:https://www.cnblogs.com/handboy/p/7163918.html