Friday, September 11, 2009

XML and Streams with C#

I wanted to write xml to a stream and back because of the XMLDocument think.

You can go back and forth from XMLDocuments to Streams by:

MemoryStream streamName = new...();

streamName.Write( [ innerXML as byte array ], 0, [size of array]);

XMLDocument document = new ...();

document.Load(streamName);


Now you have a xmldocument.

No comments:

Post a Comment