Application Settings File: Folder Location
-
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.
-
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.
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
-
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.
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'
-
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'
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
-
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
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 -
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.aspYes, that's the right solution. 'A programmer is just a tool which converts caffeine into code'