EDN Admin
Well-known member
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
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