Jul 01
Here is the easiest way to read an entire text file into a C# string:
string s = System.IO.File.ReadAllText( path );
Copyright © 2007-8 Tiwebb Ltd. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without explicit permission from Tiwebb Ltd.


It is interesting to notice that the File.ReadAllText and File.ReadAllLines methods were added in the version 2.0 of the .NET framework; mainly because in the previous versions, the necessary usage of a Stream object made reading text files difficult and unintuitive for most of the developers.
thanx