nvert xdocumnet to memory Stream

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello ,
I have write code to convert xdocumnet to memory stream but it is not working :
MemoryStream ms = new MemoryStream();<br/>
<br/>
XmlWriterSettings xws = new XmlWriterSettings();<br/>
<br/>
using (XmlWriter xw = XmlWriter.Create(ms))<br/>
{<br/>
XDocument doc = new XDocument(new XDeclaration("1.0", "utf-8", "true"),<br/>

new XElement("Title", "aaaa"));<br/>
<br/>
doc.WriteTo(xw);<br/>
<br/>
Console.WriteLine(ms.Length);<br/>
}

the length is 0 .
so how I convert it?
<hr class="sig ASk

View the full article
 
Back
Top