首先引入服务 然后 调用 本文转载自http://blog.sina.com.cn/s/blog_7eeb43210101hf7f.html public class Computer { public static string CpuID; //1.cpu序列号 public static string MacAddress; //2.mac序列号 public static string DiskID; //3.硬盘id public static string IpAddress; //
一.通过WMI获取物理适配器序号 NetEnabled: 是否启用了适配器,True为启用,False为禁用;PhysicalAdapter: 适配器是否物理或逻辑适配器,True为物理,False为逻辑; public static List<int> GetUseIndex() { List<int> list = new List<int>(); ManagementClass mc = new ManagementClass("Win32_Networ