How to find the drive letter of an USB mass storage drive using VID and PID in C#?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-04 05:54:22

问题


We design a USB MSD product, for that we need to write a C# application which will do some processing on the files stored in the memory.

Can anybody advise me,how to detect whether an USB device with a particular VID+PID is connected to the computer and if so, what is the drive letter(Or root drive path)?

I could able to find examples to detect whether a particular(VID+PID) USB device is present or not. And also could able to find example programs to detect the available removable drives and what is the path...etc.

Is there any example programs in C# combining these together?

Thanks for the support.


回答1:


I was going suggest using a wrapper around the SetupApi but it looks like someone else has already put together a really good answer. DEVCON.EXE (driver tool) and OpenVPN



来源:https://stackoverflow.com/questions/15740613/how-to-find-the-drive-letter-of-an-usb-mass-storage-drive-using-vid-and-pid-in-c

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