April 11, 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);

Ditulis Oleh : Angelo Hari: 5:30 PM Kategori:

0 comentarios:

Post a Comment