|
-
Jan 30th, 2006, 07:02 PM
#1
Thread Starter
New Member
Writing to New XML File Throws IOException
VB Code:
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
-
Jan 31st, 2006, 05:19 AM
#2
Fanatic Member
Re: Writing to New XML File Throws IOException
only need for one slash '/'
Dim loXmlWriter As New Xml.XmlTextWriter("\My Documents\mcsd.fclib", System.Text.Encoding.UTF8)
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|