Read text from file
29-12-2015 10:58:08
C# / IO
0 Bookmark(s)
225 View(s)
To read the content of a text file into a string you can use:
string content = File.ReadAllText(@"C:\temp\test.txt", Encoding.UTF8))
Or if you prefer the content as an array of lines
string[] lines = File.ReadAllLines(@"C:\temp\test.txt", Encoding.UTF8));