Use XmlReader to read xml data from a FileStream in CSharp

Description

The following code shows how to use XmlReader to read xml data from a FileStream.

Example


  //from   www  . ja  va  2  s  . c  o  m
  
  
     

using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;

public class MainClass{
   public static void Main(){
        FileStream fs = new FileStream(@"C:\data\books.xml", FileMode.OpenOrCreate, FileAccess.Read, FileShare.Read);
        
        XmlReader reader = XmlReader.Create(fs);
   }
}




















Home »
  C# Tutorial »
    XML »




Load Parse
Document
Element
Attribute
Namespace
Query
Save
Schema
Style