I am new to
Vb and XML So how would I write a XML file like the following?
Code:
<?xml version="1.0" encoding="utf-8"?>
<Data>
<Info>
<Media ID="0048745.ini" Tid="0048745" TN="Get Bent" NT="480" TM="8500" DownloadLink="www.???.???" />
</Info>
</Data> This is the code I use that does not work correctly.
Code:
Imports System.Xml
Public Class frmMain
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click
Dim settings As New XmlWriterSettings()
settings.Indent = True
Dim XmlWrt As XmlWriter = XmlWriter.Create(Application.StartupPath & "XmlTest.xml", settings)
With XmlWrt
.WriteStartDocument()
'.WriteComment("This is a test file.")
.WriteStartElement("Data")
.WriteStartElement("Info")
.WriteStartElement("Media")
.WriteAttributeString("ID", value:="0048745.ini" & "Tid")
.WriteEndElement()
.WriteEndDocument()
.Close()
End With
ShowXml()
End Sub
How would I read the info in the XML into different text boxes?
Thank you for your help!