Friday, 10 October 2014

How to convert Stream to string?

To convert Stream to string write the following code:

public  string StreamToString(Stream stream)
{
 
 
 stream.Position = 0;

using (StreamReader reader = new StreamReader(stream))

{
 
 
return reader.ReadToEnd();
}

}
 
 
 

No comments:

Post a Comment