CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2016
    Posts
    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?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    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
  •  





Click Here to Expand Forum to Full Width

Featured