Example: Two USB's are connected at Slot 3 and Slot 7. So, I want a list which will show Slot 3 and Slot 7 have USB and rest slot are empty. I have tried using WMI Query Win32_USBHub. But here I am only getting 6 device id's and not 10. I am differentiating the ports using common VID for the Device ID. But still even after getting the USB's connected to the specific port. I want to get their corresponding slot in which they are connected to USBHub. I am not able to identify the slot in which the USB is connected and where the slot is empty.
ManagementObjectCollection collection; var searcher = new ManagementObjectSearcher(@"Select * From Win32_USBHub"); collection = searcher.Get();
Rahul AnandPosted May 29, 2017, 12:05 PM