简体   繁体   中英

Searching for SD-cards

I need to implement searching for SD-cards in my program.

Currently I'm using search for all removable devices like:

searcher = New Management.ManagementObjectSearcher("\\localhost\root\cimv2", "SELECT DeviceId FROM Win32_LogicalDisk WHERE DriveType=2 AND Size>0");

But it find USB flash drives also. Is there a proper way to find SD-cards only? What I need is in general only drive letter for available SD-cards (like "F:" or so).

The SD cards use to have an unique ID. USB memories not. So you can use that to distinguish from USB and the SD card. I have used it in windows ce and was working properly.

I don't think this is possible - Windows doesn't distinguish an SD card in a card reader from a USB stick. In fact I'd bet that in most cases these days they're actually the same thing (ie memory stick = SD-card-on-a-USB-plug).

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