public void Set(string key, string value)
{
if (!config.AppSettings.Settings.AllKeys.Contains(key))
{
config.AppSettings.Settings.Add(key, value);
}
else
{
config.AppSettings.Settings.Remove(key);
config.AppSettings.Settings[key].Value = value;
}
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings");
}