title: Writing/Reading User-Defined settings in app.config file
body: <p>I am trying to read and write into app.config file of user-settings. I found a snippet of a code for working with confige file. I finally got it compiling and running, but it absolutely seems to be doing nothing to the App.config file.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Method MainForm1.Button1.Click(sender: System.Object; e: System.EventArgs);
  var
  config  : System.Configuration.Configuration;
  begin
       config:=ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
       config.AppSettings.Settings.Add('PreferenceToRemember','value1');
       config.Save(ConfigurationSaveMode.Modified);
       ConfigurationManager.RefreshSection('appSettings');
  end;
  </code></pre>
  
  <p>It is compiling without any errors, but I don't know if it is doing anything.</p>
  
  <p>Is there anything wrong with the code? I need to be able to write/read a section and write/read a key/value. Thanks in advance.</p>
  
  <p><strong>UPDATE: Instead of using ConfigurationManager, I simply use Properties.Settings.Default. However, I am having bit of a problem writing into it and reading back from it, although program complies with without any errors and the code seems simple.</strong></p>
  
  <p><strong>How do you read and write to Properties.Settings.Default from within your code?</strong></p>