win32_USB设备从Win32类丢失 [英] win32_USBDevice is missging from Win32 Classes

查看:761
本文介绍了win32_USB设备从Win32类丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试检索连接的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,后来我遇到这个链接:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394084(v = vs.85).aspx

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类丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆