viernes, 11 de abril de 2014

How to modify my App.exe.config keys at runtime


On some occasions we need to store values ​​in app.config file confirguracion from our own application at runtime. 

Without giving a lot of thought I will show one of the methods that I used to do, and is as follows:



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

config.AppSettings.Settings["Test"].Value = "valueTest";
config.Save(ConfigurationSaveMode.Modified);

ads

Ditulis Oleh : Mandrake as Angelo Hari: 14:30 Kategori:

0 comentarios: