Detect Storage Card Root Folder Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing an application in C# and I was wondering if there is a
way to detect the name of the storage card folder, specifically if its name
is "SDMMC Disk" or "Storage Card" this way I can grab that folder name no
matter what it is and use it in another string to locate a file on the
Storage Card.

Thanks
 
Keep also in mind that you'll get a system mounted ROM storage(s) if it's
present on the device. For example on HP devices there is \IPAQ File Store
that'll be treated exactly the same as storage card. Unfortunately I was not
able to find a certain way to indentify the one vs. another.

--
Alex Yakhnin, .NET CF MVP
www.intelliprog.com
www.opennetcf.org
 
The same effect happens on our devices, also, where on-board FLASH is
mounted as filesystem entries, but there's no way, other than knowing that
it's present, to know that it's persistent.

Paul T.
 
This worked great! thanks for the help.
I tested it on an Intermec Device and got the correct foldername
However I am not sure if it is correct on the IPAQ Device as Alex mentioned.
I am getting back the IPAQ File Store but I am not sure if that is correct.

Thanks Again Peter.
 
Thanks for the response, I am using an IPAQ and I do infact get back the
\IPAQ File Store but I am not sure if this is the actual storage card or not.

Do you know how I can do a Cold Boot on the IPAQ so that I loose everything
on the device except the OS and necessary files?

Thanks
 
Below is the Code I used to Find the Root Folder Name of the SD Card and put
it in to an arraylist so that I can show it to my app.

DirectoryInfo rootDir = new DirectoryInfo(@"\");

FileAttributes attrStorageCard = FileAttributes.Directory |
FileAttributes.Temporary;

ArrayList myAttr = new ArrayList();



foreach( FileSystemInfo fsi in rootDir.GetFileSystemInfos() )
{


if ( (fsi.Attributes & attrStorageCard) == attrStorageCard )
{
//Found storage card
myAttr.Add(fsi.FullName.ToString());
}
}

for(int i=0; i<myAttr.Count; i++)
{
string pStorage;
pStorage = myAttr.ToString();

if(pStorage == @"\SDMMC Disk")
{
txtresult.Text = pStorage;
}
}

//The above code is finding the root folder name of the SD Card of an Intermec
//Hand Held Device, which the foldername we know ahead of time is SDMMC Disk
 
Back
Top