I have the following in my config file :
To update the node I use the following :Code:<configuration> <appSettings> <add key="ServerIPAddress" value="127.0.0.14444" /> </appSettings> </configuration>
Which works fine but what I want to know is :Code:Dim doc As New XmlDocument() configName = "myconfig.config" doc.Load(configName ) 'ServerIPAddress Dim elServerIPAddress As XmlElement = DirectCast(doc.SelectSingleNode("/configurationappSettingsadd[@key='ServerIPAddress']"), XmlElement) If elServerIPAddress IsNot Nothing Then elServerIPAddress.SetAttribute("value", Me.txtServerIP.Text) End If
If the node does not exist how do I create it ?
Thanks in Advance folks :-)





Reply With Quote