Colud我把XmlDocument doc = new XmlDocument()放在一边使用方法,如果不是那么为什么 [英] Colud i put XmlDocument doc = new XmlDocument() in side using method if nott then why

查看:83
本文介绍了Colud我把XmlDocument doc = new XmlDocument()放在一边使用方法,如果不是那么为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Colud我把XmlDocument doc = new XmlDocument()放在一边使用方法,如果没有那么为什么





使用(XmlDocument doc = new XmlDocument())

{

// -------



/ / ---------

}



谢谢

Colud i put XmlDocument doc = new XmlDocument() in side using method as below if not then why


Using(XmlDocument doc = new XmlDocument())
{
//-------

//---------
}

Thanks

推荐答案

您好,



要使用使用,您要使用的类必须实现IDisposable。 />


XmlDocument没有实现它,所以你不能这样做。



http://msdn.microsoft.com/en-us/library/yh598w02.aspx [ ^ ]



Valery。
Hello,

To use using , the class you want to use must implement IDisposable.

XmlDocument does not implement it, so you can't do that.

http://msdn.microsoft.com/en-us/library/yh598w02.aspx[^]

Valery.


这篇关于Colud我把XmlDocument doc = new XmlDocument()放在一边使用方法,如果不是那么为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆