May 17
This tutorial will help you to change the values <appSettings> when you are deploying the application. Maybe we need to set application configuration parameters because we change our database to another server. This is code snippet to do it.
[code lang="vbnet"]
Private Sub ChangeAppSettings(ByVal KeyName As String, ByVal KeyValue As String)
Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
config.AppSettings.Settings(KeyName).Value = KeyValue
config.Save(ConfigurationSaveMode.Modified)
ConfigurationManager.RefreshSection("appSettings")
End Sub
[/code]





2 Responses to “Modify app.config files”
Trackbacks
Leave a Reply