views:

1123

answers:

2

someone to example coding me thank

key and value save in app.config

A: 

Something like this may be : http://geekswithblogs.net/akraus1/articles/64871.aspx

Kris-I
why i cant see ConfigurationManager class
monkey_boys
add : using System.Configuration;in the using section
Kris-I
A: 
  • asp.net

Configuration config = WebConfigurationManager.OpenWebConfiguration(null); AppSettingsSection app = config.AppSettings; app.Settings.Add("x", "this is X"); config.Save(ConfigurationSaveMode.Modified);

  • winform

Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); AppSettingsSection app = config.AppSettings; app.Settings.Add("x", "this is X"); config.Save(ConfigurationSaveMode.Modified);

Edwin Tai
when i open app.config it not write "x" and "this is x"
monkey_boys