//open app.config
Configuration cfnData = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
//add app settings
cfnData.AppSettings.Settings.Add("1","0");
//remove settings
cfnData.AppSettings.Settings.Remove("1");
//save app settings
cfnData.Save(ConfigurationSaveMode.Modified);
//check
whether app.config is null
string [] strName =ConfigurationManager.AppSettings.AllKeys;