XmlReader.Close XmlReader.Close XmlReader.Close XmlReader.Close Method

定义

当在派生类中被重写时,将 ReadState 更改为 ClosedWhen overridden in a derived class, changes the ReadState to Closed.

public:
 abstract void Close();
public abstract void Close ();
abstract member Close : unit -> unit
Public MustOverride Sub Close ()

异常

在上一次异步操作完成之前调用了 XmlReader 方法。An XmlReader method was called before a previous asynchronous operation finished. 在此情况下,会引发 InvalidOperationException 并显示消息“异步操作已在进行中。”In this case, InvalidOperationException is thrown with the message "An asynchronous operation is already in progress."

注解

此方法还释放读取过程中保留的任何资源。This method also releases any resources held during reading. 如果Close已调用,则不执行任何操作。If Close has already been called, no action is performed.

适用于