dafatdude
Jan 30th, 2006, 06:02 PM
Try
Dim loXmlWriter As New Xml.XmlTextWriter("\\My Documents\\mcsd.fclib", System.Text.Encoding.UTF8)
loXmlWriter.WriteStartDocument()
loXmlWriter.WriteStartElement("testlib")
loXmlWriter.WriteStartElement("info")
loXmlWriter.WriteAttributeString("name", "MCSD 70-306")
loXmlWriter.WriteEndElement()
loXmlWriter.WriteStartElement("questioncollection")
loXmlWriter.WriteStartElement("question")
loXmlWriter.WriteAttributeString("qtext", "What is the latest version of windows")
loXmlWriter.WriteAttributeString("atext", "Windows XP")
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndDocument()
loXmlWriter.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Hello all.
The above code throws an exception in the .NET framework when on the first line where it tries to write the file. What am i doing wrong, it can't be to compilcated but i can't for the life of me work it out.
Can someone help?
Also, if there is a better way to do this, please post :)
Thanks
Dim loXmlWriter As New Xml.XmlTextWriter("\\My Documents\\mcsd.fclib", System.Text.Encoding.UTF8)
loXmlWriter.WriteStartDocument()
loXmlWriter.WriteStartElement("testlib")
loXmlWriter.WriteStartElement("info")
loXmlWriter.WriteAttributeString("name", "MCSD 70-306")
loXmlWriter.WriteEndElement()
loXmlWriter.WriteStartElement("questioncollection")
loXmlWriter.WriteStartElement("question")
loXmlWriter.WriteAttributeString("qtext", "What is the latest version of windows")
loXmlWriter.WriteAttributeString("atext", "Windows XP")
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndElement()
loXmlWriter.WriteEndDocument()
loXmlWriter.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Hello all.
The above code throws an exception in the .NET framework when on the first line where it tries to write the file. What am i doing wrong, it can't be to compilcated but i can't for the life of me work it out.
Can someone help?
Also, if there is a better way to do this, please post :)
Thanks