Dennis Bottjer | ASP.NET + SharePoint Architect, Trainer & Speaker

"An Ounce of Prevention is Worth a Pound of Cure" - Ben Franklin
posts - 168, comments - 59, trackbacks - 41

My Links

News

Add to Technorati Favorites The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.

Tag Cloud

Archives

Post Categories

XmlDocument to Byte[]

1
2
3
4
5
6
7
8
9
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);

// Save Xml Document to Text Writter.
doc.WriteTo(xw);
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();

// Convert Xml Document To Byte Array.
byte[] docAsBytes = encoding.GetBytes(sw.ToString());

Print | posted on Wednesday, October 11, 2006 3:01 AM | Filed Under [ C# & .NET Tutorials XML ]

Comments have been closed on this topic.

Powered by: