Add values to app.config and retrieve them
<p>I need to insert key value pairs in app.Config as follows:</p>

<pre><code>&lt;configuration&gt;
 &lt;appSettings&gt;
    &lt;add key="Setting1" value="Value1" /&gt;
    &lt;add key="Setting2" value="Value2" /&gt;
 &lt;/appSettings&gt;
&lt;/configuration&gt;
</code></pre>

<p>When I searched in google I got the following code snippet</p>

<pre><code>System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); // Add an Application Setting.

config.AppSettings.Settings.Add("ModificationDate",
               DateTime.Now.ToLongTimeString() + " ");

// Save the changes in App.config file.

config.Save(ConfigurationSaveMode.Modified);
</code></pre>

<p>The above code is not working as ConfigurationManager is not found in System.Configuration namespace I'm using .NET 2.0.
How to add key-value pairs to app.Config programatically and retrieve them?</p>
