Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 04-19-2007, 07:49 PM   #1 (permalink)
Forum Expert
 
Join Date: Feb 2004
Age: 23
Posts: 488
Send a message via MSN to jocan2003
Default Create XML file

How do i create a XML file? so far my code look like this.

Code:
XmlDocument catchdocXML = new XmlDocument();
                catchdocXML.CreateXmlDeclaration("1.0", "UTF-8", "yes");
                catchdocXML.CreateElement("main");
                catchdocXML.Save(@"Annuaire.xml");
                MessageBox.Show("Le fichier Annuaire.XML etait inexistant, celui ci a eter creer automatiquement, VEuiller recommencer.");// the file had not been found, a new one has been created, please try again.
but with this code i get an exeption wich is The document dont have valid root element how do i fix that?
__________________
Admin of Crystal World, French shard
Under Construction
http://www.crystalworld.over-blog.com/
If there is another lifeform in the universe, they are wise enough to avoid our babaric civilisation.
jocan2003 is offline   Reply With Quote
Old 04-19-2007, 09:42 PM   #2 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
Default

Look at my XML tutorial in the FAQ forum (and I think i have a link to it in my sig). It shows one way to create an xml file. There are many more ways to do it, but that was the only way I actually knew how when i wrote the tutorial.
mordero is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5