ARTICLE

Reading XML Files

Posted by Mahesh Chand Articles | Visual Basic 2010 May 25, 2004
XmlTextReader class is a class you might want to look into if you want to read XML files. Just pass your XML file as an argument when you create XmlTextReader object and call read() method to read the document.
 
Reader Level:

XmlTextReader class is a class you might want to look into if you want to read XML files. Just pass your XML file as an argument when you create XmlTextReader object and call read() method to read the document.

After calling read method, you can go though the document node by node and get the data.

Source Code:

Imports System
Imports
System.Xml
Module
Module1
Sub
Main()
' Open an XML file
Dim reader As XmlTextReader = New
XmlTextReader("C:\\out.xml")
While
reader.Read()
Console.WriteLine(reader.Name)
End
While
End
Sub
End
Module

share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor