我要避免的是:
ManagementClass m = new ManagementClass("Win32_LogicalDisk");
ManagementObjectCollection managementObjects = m.GetInstances();
List<ManagementObject> managementList = new List<ManagementObject>();
foreach(ManagementObject m in managementObjects){
managementList.Add(m);
}
没有一种方法可以将该集合放入看起来像这样的List中:
List<ManagementObject> managementList = new List<ManagementObjec>(collection_array);