I have a textbox where I can input the start page url and an "apply" button, I got the apply button to work, and the URL saves into my_start_url.xml.
With this code [that works perfect]
' The XmlTextWriter that will build the XML file
Dim myXmlWriter As New Xml.XmlTextWriter(Application.StartupPath + "\my_start_url.xml", Nothing)
' Start writing the document
myXmlWriter.WriteStartDocument()
' Add the root node
myXmlWriter.WriteStartElement("urls")
myXmlWriter.WriteStartElement("url")
myXmlWriter.WriteAttributeString("string", Nothing, Me.HomeUrl.Text)
myXmlWriter.WriteEndElement()
' Write the end elements and finish writing the document
myXmlWriter.WriteEndElement()
myXmlWriter.WriteEndDocument()
myXmlWriter.Close()
So I can save the text box input in the XML file, but now I'm working on displaying the XML data into the text box.
And it's not going so well
I used the following code [wich doesn't work right, see the File Attachment]
Private Sub Options_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create a new instance of XmlDocument
Dim myXmlDocument As Xml.XmlDocument = New Xml.XmlDocument()
' This will handle XML nodes in the XML file
Dim myNode As Xml.XmlNode
' This will contain the URL from the XML attribute
Dim URL As String
' Load the XML document
myXmldocument.Load(Application.StartupPath + "\my_start_url.xml")
' Load the URL into the textbox.
URL = myNode.Attributes("string").InnerText
HomeUrl.Text = URL
End Sub
EDIT:
Here's the XML file "my_start_url.xml"
<?xml version="1.0" ?> - <urls> <url string="http://www.cilisoft.tk" /> </urls>
Can anyone help me please? I would really appreciate that loads! Thank you
Attached image(s)
This post has been edited by fr4gory: 04 January 2009 - 08:39 AM

New Topic/Question
Reply




MultiQuote




|