-
July 31st, 2016, 04:10 PM
#1
SpecialFolder.ApplicationData under Windows CE 5.0
Hello
I am new to C#. I try to create a Game on a Windows CE 5.0 mobile device using VisualStudio 2008 and .net 3.5 on a Windows10 64bit computer.
I try to load and save data from csv-file. As Windows CE 5.0 does not have C:\ i try to acces the folder with 'Enviroment.SpecialFolder.ApplicationData'
My actual problem is that on the device it is working, but not in Debug.
What I did try is:
I have on the device the mu001.exe that is in the ApplicationFolder called BACKUP where the TestFile.csv will be created.
on my windows10 I did create the folder C:\Users\Admin\AppData\Roaming\Wonderland\BACKUP
The code is i tried is:
Code:
var filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Wonderland\BACKUP\TestFile.csv");
StreamWriter writer;
string str = "Test-Text";
using (writer = File.AppendText(filePath))
{
writer.WriteLine(str);
writer.Close();
}
on the device it is creating the csv-file next to the exe but while debug-mode it gives the error Could not find a part of the path '\Application Data\Wonderland\BACKUP\TestFile.csv'.
what do i do wrong?
-
August 3rd, 2016, 12:31 AM
#2
Re: SpecialFolder.ApplicationData under Windows CE 5.0
Check the return of GetFolderPath. If it's empty, get the path to the application.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|