SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Reading A XML file in VS?

rated by 0 users
This post has 2 Replies | 1 Follower

Top 150 Contributor
Posts 11
Raven87 Posted: 09-05-2005 2:00 AM

harlow

I am having a problem trying to read a XML document, i had hear the simplest way is to a use a XMLTextReader, but i am not sure for how to implement it....

Regards
maurice 

Top 25 Contributor
Posts 485
 Raven87 wrote:

I am having a problem trying to read a XML document, i had hear the simplest way is to a use a XMLTextReader, but i am not sure for how to implement it...


Hi Raven87, a pretty easy way I used is to use the XmlDocument object. With it, you can load in an xml for processing.

//C#
using System.XML

XmlDocument D= new XmlDocument();
D.Load("filename.xml"); //if the source xml is a file


//Do some changes, or read it, example:
D.FirstChild.Value = "Hello World";

//Save the changes back to same file
D.Save("filename.xml");

Big Smile [:D]

Yes, another version, another round of headaches. But that's progress.
Top 150 Contributor
Posts 11

oic....
thankz for the help, actually my name is maurice...haha...and actually i quite new to c#, so i still a bit blur, but thankz for the code, it really help me alot...

Regards
maurice

Page 1 of 1 (3 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems