XmlReader.Dispose 方法
定义
重载
| Dispose() |
释放 XmlReader 类的当前实例所使用的所有资源。Releases all resources used by the current instance of the XmlReader class. |
| Dispose(Boolean) |
释放由 XmlReader 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the XmlReader and optionally releases the managed resources. |
Dispose()
public:
virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()
实现
例外
在上一次异步操作完成之前调用了 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."
适用于
Dispose(Boolean)
protected:
virtual void Dispose(bool disposing);
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)
参数
- disposing
- Boolean
若要释放托管资源和非托管资源,则为 true;若仅释放非托管资源,则为 false。true to release both managed and unmanaged resources; false to release only unmanaged resources.
例外
在上一次异步操作完成之前调用了 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."