I am using wince 5.0 for logicpd pxa270 som card and dotnet 1.1 sp1. When the image file (NK.bin) is formed and burnt to the device, it works fine with built in memory of the SOM card. Suppose I have some data in the flash memory and using the application in the device, I want to read those data. What should I do? What API I need to use? Do I need some changes in OS catalog view?
Asked
Active
Viewed 906 times
0
-
Wouldn't you just use the .Net Framework for that? Something simple like `StreamReader`. Also check http://www.opennetcf.org/Products/SmartDeviceFramework.aspx might be useful for you. – Jeremy Apr 16 '12 at 05:43
-
I have got help from here. But it doesnt work http://stackoverflow.com/questions/40269/finding-the-storage-card-path-on-wm6 . basically i want to use something simple. memory of SOM card will read from flash memory attached to the board. Thats the issue. Do you think using something simple like StreamReader still solve the problem? – Abdullah Saurav Apr 16 '12 at 05:56
1 Answers
0
Ok, I got the answer. The following code snippet works fine. Suppose you are using a mobile device and the memory of SOM card. If you have a file in the external flash memory of the device and the file is in a folder named 'myFolder', the following code snippet returns '\myFolder'
public static string GetStorageCard()
{
//initialize the path as an empty string
string firstCard = "";
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo("\\");
System.IO.FileSystemInfo[] fsi = di.GetFileSystemInfos();
//iterate through them
for (int x = 0; x < fsi.Length; x++)
{
//check to see if this is a temporary storage card (e.g. SD card)
if ((fsi[x].Attributes & System.IO.FileAttributes.Temporary) == System.IO.FileAttributes.Temporary)
{
//if so, return the path
firstCard = fsi[x].FullName;
}
}
return firstCard;
}

Abdullah Saurav
- 33
- 1
- 1
- 9