C#:Read a Text File
From Progzoo
Read Text File
You can open a text file and read each line.
- The
StreamReaderrepresents a text file that can process one
line at a time.
- We use the
ReadLinemethod to obtain a single line of text. - When the file has been exhausted the string returned will be
null.
The text file [../haggis.txt haggis.txt] includes some lines of text.
[Font]
[Default]
[Show]
[Resize]
[History]
[Profile]