Searching for SD-cards

强颜欢笑 提交于 2020-01-01 12:18:28

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2453127/searching-for-sd-cards

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