我怎样才能把一个XDocument成一个流?XDocument

由网友(你自私的鲁莽丶)分享简介:可能重复: 转换的XDocument到流 这个问题不言自明的 - 我怎么把一个的XDocument 到流不保存任何磁盘? The question speaks for itself - how do I turn an XDocument into a Stream without saving anythin...

可能重复:   转换的XDocument到流

这个问题不言自明的 - 我怎么把一个的XDocument 不保存任何磁盘?

The question speaks for itself - how do I turn an XDocument into a Stream without saving anything to disk?

推荐答案

将其保存到的MemoryStream

Stream stream = new MemoryStream();
doc.Save(stream);
// Rewind the stream ready to read from it elsewhere
stream.Position = 0;
阅读全文

相关推荐

最新文章