Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Application Settings File: Folder Location

Application Settings File: Folder Location

Scheduled Pinned Locked Moved C#
csharpdatabasequestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    M 2000
    wrote on last edited by
    #1

    I have application settings (Configurations) which can be modified by the user at runtime. The settings are stored in a file or in a database. Where do I locate this file? E.g. the installation folder C:\Program Files\MyExampleProgram\Settings is write-protected for a normal user. The C# program is installed on Windows Systems post Win98SE.

    S A 2 Replies Last reply
    0
    • M M 2000

      I have application settings (Configurations) which can be modified by the user at runtime. The settings are stored in a file or in a database. Where do I locate this file? E.g. the installation folder C:\Program Files\MyExampleProgram\Settings is write-protected for a normal user. The C# program is installed on Windows Systems post Win98SE.

      S Offline
      S Offline
      S Senthil Kumar
      wrote on last edited by
      #2

      Can't you put it in the application installation directory? In fact, the standard App.Config file gets placed in the same directory as the executable, with the extension executablename.exe.config. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

      1 Reply Last reply
      0
      • M M 2000

        I have application settings (Configurations) which can be modified by the user at runtime. The settings are stored in a file or in a database. Where do I locate this file? E.g. the installation folder C:\Program Files\MyExampleProgram\Settings is write-protected for a normal user. The C# program is installed on Windows Systems post Win98SE.

        A Offline
        A Offline
        Andre Ziegler
        wrote on last edited by
        #3

        Hi Put the config-file in the application data path in the Home-directory of the User on NT-based OS (C:\documents and settings\%UserName%\Application Data\). André 'A programmer ist just a tool which converts caffeine into code'

        M 1 Reply Last reply
        0
        • A Andre Ziegler

          Hi Put the config-file in the application data path in the Home-directory of the User on NT-based OS (C:\documents and settings\%UserName%\Application Data\). André 'A programmer ist just a tool which converts caffeine into code'

          M Offline
          M Offline
          M 2000
          wrote on last edited by
          #4

          Hello Thanks for the reply! Can I read the Home-directory folder out of the system settings? Or how should I handle multi language installations (french, german, ...) which do not name the folder 'documents and settings' but 'dokumente und einstellungen' for instance? Greetings

          M 1 Reply Last reply
          0
          • M M 2000

            Hello Thanks for the reply! Can I read the Home-directory folder out of the system settings? Or how should I handle multi language installations (french, german, ...) which do not name the folder 'documents and settings' but 'dokumente und einstellungen' for instance? Greetings

            M Offline
            M Offline
            M 2000
            wrote on last edited by
            #5

            One solution is to read out the information with the GetFolderPath function: string strFolderName = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData; For details see: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemEnvironmentSpecialFolderClassTopic.asp

            A 1 Reply Last reply
            0
            • M M 2000

              One solution is to read out the information with the GetFolderPath function: string strFolderName = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData; For details see: http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemEnvironmentSpecialFolderClassTopic.asp

              A Offline
              A Offline
              Andre Ziegler
              wrote on last edited by
              #6

              Yes, that's the right solution. 'A programmer is just a tool which converts caffeine into code'

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups