问题描述
我尝试检索连接的USB设备的PID和VID。从这行C#代码开始:
I am trying to retrieve PID and VID of a connected USB device. Starting with this line of C# code:
System.Management.ManagementClass USBClass = new ManagementClass("Win32_USBDevice");
然后我得到异常ManagementException not found
,后来我遇到这个链接:
Then I got exception "ManagementException not found"
, Later I run into this link:http://msdn.microsoft.com/en-us/library/windows/desktop/aa394084(v=vs.85).aspx
原来 Win32_USBDevice
根本不在列表中。尝试 Win32_USBController
但没有得到我想要的。任何人都可以让我知道列表中是否有任何替代类来提取连接的USB设备的PID和VID?
It turned out Win32_USBDevice
was not on the list at all. Tried Win32_USBController
but didn't get what I wanted. Could anyone let me know if there is any substitute class on the list to extract PID and VID of a connected USB device?
提前感谢!
推荐答案
尝试:
System.Management.ManagementClass USBClass = new ManagementClass(Win32_USBHub);
这篇关于win32_USB设备从Win32类丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!