You should be careful with assumptions... as each manufacturer will
determine what these 'defaults' will be. I have found it far more reliable
to present the user with a file dialog that asks them to point to file store
on their device. This provides the best results for all hardware, all
potential storage locations and is user proof...
As Rick said you should be aware that the name of the storage card may
change from device to device and from country to country.
What I've done is to use System.IO.Directory to read all the directories
contained on the root folder, and then P/Invoke: GetFileInformationByHandle
to see if the volume number is different from zero.
cfyam, you shouldn't check the existance of a certain directory.
I haven't tried it so far, but maybe you could use functions
FindFirstStore() and FindNextStore() to gather STORAGEDEVICEINFO structures
and check dwDeviceType field for STORAGE_DEVICE_TYPE_PCCARD and
STORAGE_DEVICE_TYPE_CFCARD ? Maybe this structure (or PARTINFO structure)
contains even a field which holds the mount point ...
Each device type can use different names for storage cards and they can also
be localised into numerous languages so this approach will only work on
specific devices.
A better approach (no P/Invokes required) is to enumerate all the top level
folders which have the Directory and Temporary. Alex Feinman produced a
useful code sample to do this here:- http://www.opennetcf.org/forums/topic.asp?TOPIC_ID=432
Peter
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.