I need some help with this one. Ok, I want to create an xml file of all my mp3 files on my home pc.:S
I am using the code as follows:-
Public Class Form1 Dim myWriter As New System.Xml.XmlTextWriter myWriter = New System.Xml.XmlTextWriter("C:\music_stuff.xml", Nothing) With myWriter .Indentation = 4 .IndentChar = " " .Formatting = . Indentation .WriteStartDocument() .WriteComment ("my freaking music yay") .WriteStartElement("mp3") .WriteElementString("id","1") .WriteElementString("title","blah blah") .WriteElementString("description", "wah wah wah") .WriteEndElement() .WriteEndDocument() End With myWriter.Flush() myWriter.Close() End Class
It gives output something like:-
<?xml version="1.0" ?> <!-- my freaking music yay --> <mp3> <id>1</id> <title>blah</title> <description>wah wah wah</description> </mp3>
And that just works fine for one record, but I want to append to this one file all my mp3s. But I just don't know how to append, well I have an idea but it is long winded. What's gonna be the best way?