我正在使用流创建XmlDocument,并对XmlDocument进行一些更改,然后将XmlDocument保存到流本身中。
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(fileStream);
////
////
////
xmlDocument.Save(fileStream);
//how to dispose the created XmlDocument object.
现在我该如何销毁XmlDocument对象?
xmlDocument = null;
但你也可以让它超出范围。垃圾回收器会处理剩下的部分。 - Fildor