Fog Creek Software
Discussion Board

Welcome! and rules

Joel on Software

file read problem

I am using stream.readtoend method to read a text file.
I tried out this code to read a simple text file whose contents are...
but it only reads the the first 2 and and 4th character of the file, it never reads the third character. what i identified is...that this code never reads any character having ascii value greater than 127. why is that ? what if i also want to read that value?


Saturday, April 12, 2003

You should use another Encoding to read from file.
Something like this:

StreamReader sr;
sr = new StreamReader(fileName, System.Text.Encoding.Default);
curLine = sr.ReadLine();

Mikhail Andronov
Saturday, April 12, 2003

*  Recent Topics

*  Fog Creek Home