static void Main(string[] args) { // 结束Word进程 KillProcess("WINWORD"); } /// <summary> /// 结束进程名 /// </summary> /// <param name="processName">进程名</param> public static void KillProcess(string processName) { try { foreach (Process p in Process.GetProcessesByName(processName)) { if (!p.CloseMainWindow()) { p.Kill(); } } } catch { throw; } }