app.config
- <?xml version="1.0"?>
- <configuration>
- <appSettings>
- <add key="oldPlace" value="4" />
- </appSettings>
- </configuration>
Write:
- System.Configuration.Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- config.AppSettings.Settings["oldPlace"].Value = "3";
- config.Save(ConfigurationSaveMode.Modified);
- ConfigurationManager.RefreshSection("appSettings");
Read:
- string value = ConfigurationManager.AppSettings["oldPlace"];
No comments:
Post a Comment
Note: only a member of this blog may post a comment.