4

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).

Shaddix
  • 5,901
  • 8
  • 45
  • 86

2 Answers2

5

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.

Eugen Ukaj
  • 51
  • 1
  • 2
0

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 (i.e. memory stick = SD-card-on-a-USB-plug).

Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
  • there was an answer I've posted comment to, that I had a program (forgot it's name, but will search) for file recovering (as far as i remember) that actually was showing only SD-cards and not showing my USB-sticks. So somehow it's possible – Shaddix Nov 04 '10 at 08:30