Thread: Where to put a config file

  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
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    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-21-2008, 11:19 PM
  2. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  3. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03: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, 10:12 PM