Configuration cf = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); cf.AppSettings.Settings[key].Value = value; cf.Save();