using (MemoryStream ms = new MemoryStream())
{
//
// Write stuff into the memory stream with ms.Write();
//
// Jump to the start position of the stream
ms.Seek(0, SeekOrigin.Begin);
StreamReader rdr = new StreamReader(ms);
string str = rdr.ReadToEnd();
}
3 comments:
Great, straight to the point :)
Thanks. Setting the pointer to the beginning of the stream helped me in writing the stream into a string.
Straightforward and helpful. Thank you from a Chicago developer.
Post a Comment