'xml file for user choice of connection
<?xml version="1.0" encoding="utf-8" ?>
<Section Name="Settings">
<Key Name="databasepath" Value="C:\database.mdb"/>
</Section>
Loading the file at startup of app....
Private Sub ReadXmlConfig()
' Create Xml Document and load the xml file
Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.Load("C:\Neumann Plumbing and Heating\XMLDBPATH.xml") 'can
use appdirectory when finished with project.
' Read mail server value
Dim keyNodeList As XmlNodeList =
xmlDoc.DocumentElement.SelectNodes("Key")
Dim keyNode As XmlNode
For Each keyNode In keyNodeList
' Read the attributes...
Dim attribs As XmlAttributeCollection = keyNode.Attributes
Dim attrib As XmlAttribute = attribs("Name")
If attrib.Value = "databasepaths" Then
databasepath = attribs("Value").Value.ToString()
'MsgBox(databasepath)
End If
Next
End Sub
"VB Programmer" <gr*********@go-intech.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I suppose it's XML, but is there a way to easily parse/read app settings?
In ASP.NET I can use the '<appSettings>' section in the Web.config (by
calling the ConfigurationSettings.AppSettings method.) I would like to
find another similar way to do it in VB.NET.
Thanks.