Get a TextReader from a Stream?
Solution 1:
TextReader tr = new StreamReader(stream);
Solution 2:
A StreamReader
is a subclass of TextReader
, so you will be able to do:
using(var stream = System.Reflection.Assembly.GetExecutingAssembly().
GetManifestResourceStream(resource))
using(var reader = new StreamReader(stream))
{
// Use reader.
}