Note that there are some explanatory texts on larger screens.

plurals
  1. POFile not found on xp
    primarykey
    data
    text
    <p>I have a weird problem with a text file that I ship with my app.</p> <p>The file holds a bunch of sites, when the program starts it loads the sites into an array.</p> <p>On windows 7, when I start the app I don't get any errors. However, on XP I get <code>c:\Document and setting\I\Application Data\fourmlinks.txt file not found.</code> The weird part is that I made a text file with content with it, and I put it inside the application folder.</p> <p>This is how I call out in my code:</p> <pre><code>string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\fourmlinks.txt"; </code></pre> <p>My problem is that I can't create a new file because it is holding basic data that the app needs and is using.</p> <p>After the first launch the user can edit the file as much he wants.</p> <p>I'm not sure why this is happening, but this is only happening on Windows XP.</p> <p>How can I solve this problem?</p> <h1>EDIT</h1> <hr> <p>keyboardP suggest to check on what windows im runing and then change the path by it. so i came up with this code:</p> <pre><code> System.OperatingSystem osInfo = System.Environment.OSVersion; if (osInfo.Platform == PlatformID.Win32NT) path = Environment.SpecialFolder.LocalApplicationData + "\\fourmlinks.txt"; else path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\fourmlinks.txt"; </code></pre> <p>the problem that even on windows 7 i get true, when i need to get false. is there a way to make sure i run on XP or Windows 7 i diffrent way?</p> <hr> <h1>EDIT 2</h1> <hr> <p>using the check of the Operating System, I can now be sure I'm Windows 7 or Windows XP. So, the code run find again on Windows 7 but on Windows XP I get a different error message:</p> <p><img src="https://i.stack.imgur.com/rZqqM.png" alt="enter image description here"></p> <p>I really have no idea how the path that I add in my program becomes the path that the error is saying I'm requesting.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload