Identifying a device by retrieving its USB ID

我怕爱的太早我们不能终老 提交于 2019-12-13 00:35:53

问题


I'd like my application to be able to detect a where a particular USB device has been mounted, and adapt accordingly. Ideally, I'd associate paths with a USB serial number, rather than with a given path. However, I cannot figure out a simple way to access these unique IDs from VB.Net code.

Has anybody succeeded in doing this?


回答1:


You should use WMI to query for the Win32_USBControllerDevice class. Here is a blog entry showing some sample code with Powershell which you should be able to adapt easily.



来源:https://stackoverflow.com/questions/2330053/identifying-a-device-by-retrieving-its-usb-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!