var a = System.Diagnostics.Process.GetProcessesByName("QQPlayer"); if (a.Length > 0) { bool b; foreach (var s in a.Cast<Process>()) { b = !s.HasExited; //指示关联进程未终止 if (b == true) { Console.WriteLine("进程正在运行"); } else { Console.WriteLine("进程未运行"); } } } else { Console.WriteLine("该进程不存在"); }
围观,学习~~~