c# add settings.settings file code example
Example 1: c# settings file
SettingsFile.Default.MySetting = "A setting";
SettingsFile.Default.Save();
string myvalue = SettingsFile.Default.MySetting;
Example 2: add settings to config file c#
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Key0" value="0" />
<add key="Key1" value="1" />
<add key="Key2" value="2" />
</appSettings>
</configuration>
using System.Configuration;
using System.Collections.Specialized;
string sAttr = ConfigurationManager.AppSettings.Get("Key0");