Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:30:50+00:00 2026-06-13T09:30:50+00:00

I have a weird problem with a text file that I ship with my

  • 0

I have a weird problem with a text file that I ship with my app.

The file holds a bunch of sites, when the program starts it loads the sites into an array.

On windows 7, when I start the app I don’t get any errors. However, on XP I get c:\Document and setting\I\Application Data\fourmlinks.txt file not found.
The weird part is that I made a text file with content with it, and I put it inside the application folder.

This is how I call out in my code:

string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\fourmlinks.txt";

My problem is that I can’t create a new file because it is holding basic data that the app needs and is using.

After the first launch the user can edit the file as much he wants.

I’m not sure why this is happening, but this is only happening on Windows XP.

How can I solve this problem?

EDIT


keyboardP suggest to check on what windows im runing and then change the path by 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 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?


EDIT 2


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:

enter image description here

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:30:51+00:00Added an answer on June 13, 2026 at 9:30 am

    On XP, try using Environment.SpecialFolder.LocalApplicationData.

    Edit from comments

    path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\fourmlinks.txt";
    System.OperatingSystem osInfo = System.Environment.OSVersion;
    if (osInfo.Platform == PlatformID.Win32NT)
    {
       if(osInfo.Version.Major == 5 && osInfo.Version.Minor != 0) 
       {
          //running XP
          path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\fourmlinks.txt"; 
       } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a weird problem that i can't figure out a solution for: I've
I have a weird problem. I have create a bar chart using d3js that
I'm trying to work with requirejs and text plugin and I have weird problem.
I have a weird trimming problem here. I have a txt file of about
I am having a weird problem. I read a text file then I split
I have a PDF file with valuable textual information. The problem is that I
I have a multi-threaded Cocoa app that processes images. The program has a progress
I have a weird problem with a Java Gregorian Calendar: SimpleDateFormat sdf = new
I have a weird problem. When I execute a query the data is not
I have a weird problem, so I thought I would ask and see if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.