How do I convert a System.IO.Stream to a string variable.
Regards Paul
> How do I convert a System.IO.Stream to a string variable.
Do you mean you want to read the contents of a stream, decoding it into
a string, and storing the result in a variable? If so:
using (StreamReader reader = new StreamReader(stream))
{
string contents = reader.ReadToEnd();
}
Note that the above assumes an encoding of UTF-8. If you want a
different encoding, specify it in the StreamReader constructor.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too