Path of the permanent memory

  • Thread starter Thread starter Amirallia
  • Start date Start date
A

Amirallia

Hi,

Here is the code to found the storage directory :

Dim rootDir As DirectoryInfo = New DirectoryInfo("\")
Dim attrStorageCard As FileAttributes = (FileAttributes.Directory Or
FileAttributes.Temporary)
Dim fsi As FileSystemInfo
For Each fsi In rootDir.GetFileSystemInfos()
If ((fsi.Attributes And attrStorageCard) = attrStorageCard) Then
fsi.FullName
End If
Next

It's wok perfectly, but is it possible to differenciate the permanent
memory(the path of my PPC is "\iPAQ File Store") and the other
strorage directory (SD card for example) ?
 
Alex said:
As far as I know it's not possible.




Well, yes it IS possible, and it works perfectly on both PPC and Smartphone:

//--------------------------------------------
private const System.IO.FileAttributes attrStorageCard = System.IO.FileAttributes.Directory
|System.IO.FileAttributes.Temporary;


DirectoryInfo di = new DirectoryInfo(strYourFolder);
if ((di.Attributes & attrStorageCard) == attrStorageCard )
{
// if here, strYourFolder is a storage card root
}
else
{
// if here, it's not a storage card root
}

Let me know if you have any Q's

Hope it helps,
Andrey
 
It is not possible without hardcoding the names of the storage.
What if you don't know the name?

Thx...Alex
 

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.

Ask a Question

Back
Top