app config
-
Problem occurs when I exit out of the application. static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } Whatever has been written to my config file and saved to the file goes back to what it used to before. I have no idea why ? Do you guys have any idea? System.Configuration.Configuration config = null; config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(strJob, strValue); config.Save();
-
Problem occurs when I exit out of the application. static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } Whatever has been written to my config file and saved to the file goes back to what it used to before. I have no idea why ? Do you guys have any idea? System.Configuration.Configuration config = null; config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings.Add(strJob, strValue); config.Save();
Your asking for information that applies to all users, by specifying
ConfigurationUserLevel.None
. Not a per user level, which is what your trying to save. Try the other types. Also settings should be user level and not application level. Or they'll never change anyway.Using the wrong tool for the job is half the fun.
-
Your asking for information that applies to all users, by specifying
ConfigurationUserLevel.None
. Not a per user level, which is what your trying to save. Try the other types. Also settings should be user level and not application level. Or they'll never change anyway.Using the wrong tool for the job is half the fun.