Whats a Good Example to Write XML using VB.net 2008
问题 Using this example how would I go about updating an XML file using this example: <foo> <n1> <s1></s1> <s2></s2> <s3></s3> </n1> <n1> <s1></s1> <s2></s2> <s3></s3> </n1> </foo> I Can read from it all day long but for the life of me I cannot seem to write it back into that format. 回答1: Straightforward approach: ' to create the XmlDocument... ' Dim xmlDoc As New Xml.XmlDocument Dim fooElement As Xml.XmlElement = xmlDoc.CreateElement("foo") xmlDoc.AppendChild(fooElement) Dim n1Element As Xml