Jul 01
Here is the easiest way to read an entire text file into a C# string:
string s = System.IO.File.ReadAllText( path );
Related posts:
Here is the easiest way to read an entire text file into a C# string:
string s = System.IO.File.ReadAllText( path );
Related posts:
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