I have a strange problem with a text file that I am sending with my application.
The file contains a bunch of sites when the program starts loading sites into an array.
On Windows 7, when I run the application, I do not get any errors. However, on XP I get c:\Document and setting\I\Application Data\fourmlinks.txt file not found. The strange part is that I created a text file with content and I put it in the application folder.
This is how I call in my code:
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\fourmlinks.txt";
My problem is that I cannot create a new file because it contains the basic data that the application requires and uses.
After the first run, the user can edit the file as much as he wants.
I'm not sure why this is happening, but it only happens on Windows XP.
How can I solve this problem?
EDIT
keyboardP suggests checking which windows start up, and then changing the path to it. so I came up with this 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";
The problem is that even in Windows 7 I believe when I need to get false. is there any way to make sure that i am running on XP or Windows 7 in a diffrent way?
EDIT 2
using the operating system check, now I can be sure that I am Windows 7 or Windows XP. So, the code run appears again in Windows 7, but in Windows XP another error message appears:

I really have no idea how the path that I add to my program becomes the path that the error I'm asking for is talking about.