Update App.config file value

Agosto 30th, 2007

Description: Save value to the App.config file’s appSettings section

Link: http://www.codekeep.net/snippets/00e10a84-b264-437d-85bd-0ce6fe8fa620.aspx

System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings.Remove("test");
            config.AppSettings.Settings.Add("test", "testValue");
            config.Save(ConfigurationSaveMode.Modified);

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.