Home > C# > C# อ่านเขียน app.config ของโปรแกรม

C# อ่านเขียน app.config ของโปรแกรม

สิงหาคม 25th, 2009

อ่าน

string value = ConfigurationManager.AppSettings["appvalue"]; 

เขียน

System.Configuration.Configuration config =ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);   

config.AppSettings.Settings["appvalue"].Value = “3″;        

config.Save(ConfigurationSaveMode.Modified);   

ConfigurationManager.RefreshSection(“appSettings”);  

 

C#

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.