C#读写app.config中的数据

C#读写app.config中的数据
读语句:
String str = ConfigurationManager.AppSettings["DemoKey"];
 写语句:
Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
cfa.AppSettings.Settings["DemoKey"].Value = "DemoValue";
cfa.Save();

 

posted @ 2015-06-29 22:58  zscmj  阅读(157)  评论(0编辑  收藏  举报