Link to home
Start Free TrialLog in
Avatar of StuartK
StuartKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Adding Xml Fields into Newly Created NotePad

Hi,

We have createa a new file uisng this code below
We want to populate it with about three fields using Xml

We use this code, but it doesn't work.

Dim strLocalPath As String = "C:\"
    Dim strConfigFileName As String = "Master.config"
If Not System.IO.File.Exists(strLocalPath & strConfigFileName) Then
            System.IO.File.Create(strLocalPath & strConfigFileName)

            Dim xd As New Xml.XmlDocument()
            xd.Load(strLocalPath & strConfigFileName)

            Dim NewInstalled As Xml.XmlNode
            NewInstalled = xd.CreateNode(Xml.XmlNodeType.Attribute, "Installed", Nothing)
            NewInstalled.InnerText = "ABCD"

but it doesn't work. Can anyone provide suitable code to create a new InnerText within this newly created .config file!
SOLUTION
Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial