Detecting newline when reading text file one character at a time
<p>Target file:</p>

<pre><code>Hello
World
</code></pre>

<p>Code:</p>

<pre><code>if (file != null)
{
    //Read file one character at a time
    StreamReader reader;
    reader = new StreamReader(file);
    do
    {
        int s = reader.Read();
        char sC = (char)s;
        if (sC.Equals(Environment.NewLine))
        {
            Console.WriteLine("+1");
        }
        Console.WriteLine((char)s);
    } while (!reader.EndOfStream);
    reader.Close();
    reader.Dispose();
}
</code></pre>

<p>Output:</p>

<pre><code>H
e
l
l
o




W
o
r
l
d
</code></pre>

<p>So <code>(sC.Equals(Environment.NewLine))</code> obviously doesn't detect a platform independent newline when reading one char at a time.. how do I do this?</p>
