简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM