Where to put a config file

This is a discussion on Where to put a config file within the C# Programming forums, part of the General Programming Boards category; Hi, I have written a program that needs to access a config file at runtime. THe application will be run ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    6

    Where to put a config file

    Hi,
    I have written a program that needs to access a config file at runtime. THe application will be run on a number of computers.
    I am using c# express.

    It looks like the application is only installed in the start menu, so where can i put this config file so the application knows where to open it. I dont want to hardcode a path such as c:/config/config.txt , as this may not be a valid path on some computers.

    I have tried to use app.config method, but when I change the keys, I get a hash error and cant continue.

    Please Help!!!!

  2. #2
    Registered User
    Join Date
    Sep 2008
    Posts
    48
    assuming the OS is Windows
    Code:
    c:\WINDOWS\ 
    c:\WINDOWS\system32

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    Look into the IsolatedStorage class.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-22-2008, 12:19 AM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 04:44 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  4. read from .txt file & put into array?
    By slow brain in forum C Programming
    Replies: 6
    Last Post: 02-25-2003, 05:16 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 11:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21