XmlValidatingReader.Close 方法

定义

ReadState 更改为“已关闭”。Changes the ReadState to Closed.

public:
 override void Close();
public override void Close ();
override this.Close : unit -> unit
Public Overrides Sub Close ()

注解

备注

XmlValidatingReader类在 .NET Framework 2.0 中已过时。The XmlValidatingReader class is obsolete in .NET Framework 2.0. 您可以 XmlReader 使用 XmlReaderSettings 类和方法创建验证实例 CreateYou can create a validating XmlReader instance by using the XmlReaderSettings class and the Create method. 有关详细信息,请参阅 XmlReader 引用页的“备注”部分。For more information, see the Remarks section of the XmlReader reference page.

此方法还释放读取时保存的任何资源。This method also releases any resources held while reading. 如果此读取器是使用构造的 XmlTextReader ,则此方法也会对 Close 基础读取器调用。If this reader was constructed by using an XmlTextReader, this method also calls Close on the underlying reader. 如果此读取器是使用流构造的,则此方法也会对 Close 基础流调用。If this reader was constructed by using a stream, this method also calls Close on the underlying stream.

如果已 Close 调用,则不执行任何操作。If Close has already been called, no action is performed.

适用于

另请参阅