利用线程关闭已开启的应用程序,代码如下:
using System.Diagnostics;
public void CloseSoundApp() { Process[] pProcess; pProcess = Process.GetProcesses(); for (int i = 1; i <= pProcess.Length - 1; i++) { if (pProcess[i].ProcessName == "应用程序名。如QQ") { pProcess[i].Kill(); break; } } }
|
请发表评论