2014-03-31 67 views
0

什麼是設備的最獨特的ID以及如何使用C#中的ManagementObjectCollection檢索它?檢索唯一設備ID

using (var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity")) 
       collection = searcher.Get(); 

foreach (var valueString in from mo in collection.Cast<ManagementObject>()... 

預先感謝您!

回答

1

只需從管理對象中獲取"DeviceID"-property即可。