csharp System.Xml.XmlValidatingReader.IsDefault类(方法)实例源码

下面列出了csharp System.Xml.XmlValidatingReader.IsDefault 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Xm   
//引入命名空间
using System;
using System.IO;
using System.Xml;

public class Sample 
{
  public static void Main(){

    //Create the reader.
    XmlTextReader txtreader = new XmlTextReader("book4.xml");
    XmlValidatingReader reader = new XmlValidatingReader(txtreader);

    reader.MoveToContent();

    //Display each of the attribute nodes, including default attributes.
    while (reader.MoveToNextAttribute()){
        if (reader.IsDefault)
          Console.Write("(default attribute) ");
        Console.WriteLine("{0} = {1}", reader.Name, reader.Value);  
    }           
  
    //Close the reader.
    reader.Close();     
  }
} // End class


问题


面经


文章

微信
公众号

扫码关注公众号