Change setting in app.config like connection string

/ Published in: VB.NET
Save to your folder(s)

Copy this code and paste it in your HTML
  1. Dim XmlDoc As New XmlDocument()
  3. XmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
  4. For Each xElem As XmlElement In XmlDoc.DocumentElement
  5. If xElem.Name = "appSettings" Then
  6. For Each xNod As XmlNode In xElem.ChildNodes
  7. If xNod.Attributes(0).Value = 'Something key' Then
  8. xNod.Attributes(1).Value = 'Something Value'
  9. End If
  10. Next
  11. End If
  12. Next
  14. XmlDoc.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.