SD card search

I need to implement an SD card search in my program.

I am currently using the search for all removable devices, such as:

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

But he also finds USB drives. Is there a way to find only SD cards? In general, I only need the drive letter for the available SD cards (for example, "F:" or so).

+4
source share
2 answers

SD cards use a unique identifier. No USB sticks. So you can use this to distinguish between USB and SD card. I used it in windows ce and worked fine.

+5
source

I do not think it is possible - Windows does not distinguish the SD card in the card reader from the USB drive. In fact, I would say that in most cases these days they are actually the same (e.g. memory card = SD card-to-USB connector).

0
source

Source: https://habr.com/ru/post/1304239/


All Articles