Nothing happens… How do you know? You do nothing, just read the file and apparently discard the result. Use debugger to see if this code is even called. If it is not, put a break point on the method which is supposed to call this method, and so on, until you find all the ends.
Keep it simple. Use the class
System.IO.StreamReader
(you're not writing anything). You don't have to use try-finally (which is correct), because
using
statement does it all for you:
using System.IO;
using (StreamReader reader = new StreamReader(fileName, true)) {
string content = reader.ReadToEnd();
}
—SA