各位大虾看看是咋回事啊??怎么运行的时候出错误呢???
using System;
using System.Xml;
namespace ReadXml
{
class Class1
{
static void Main( string[] args )
{
// 创建一个XmlTextReader类的对象并调用Read方法来读取文件
XmlTextReader textReader = new XmlTextReader( "C:\books.xml ");
textReader.Read();
// 节点非空则执行循环体
while ( textReader.Read() )
{
// 读取第一个元素
textReader.MoveToElement();
Console.WriteLine( "XmlTextReader Properties Test ");
Console.WriteLine( "=================== ");
// 读取该元素的属性并显示在控制台中
Console.WriteLine( "Name: " + textReader.Name);
Console.WriteLine( "Base URI: " + textReader.BaseURI);
Console.WriteLine( "Local Name: " + textReader.LocalName);
Console.WriteLine( "Attribute Count: " + textReader.AttributeCount.ToString());
Console.WriteLine( "Depth: " + textReader.Depth.ToString());
Console.WriteLine( "Line Number: " + textReader.LineNumber.ToString());
Console.WriteLine( "Node Type: " + textReader.NodeType.ToString());
Console.WriteLine( "Attribute