managementobjectsearcher
using System; using System.Management; public class Sample { public static void Main(string[] args) { SelectQuery q = new SelectQuery("Win32_Service", "State='Running'"); managementobjectsearcher s = new ManagementObjectSearcher(q); foreach (ManagementObject service in s.Get()) { // show the instance console.WriteLine(service.ToString()); } } }
相关阅读
C#对window 硬件类操作,ManagementObjectSearcher
原文转载:http://blog.csdn.net/da_keng/article/details/50589145纯属转载,复制过来方便编程时寻找。感谢作者:I-Awakening复制前补