Last active
December 20, 2015 20:51
-
-
Save sdurandeu/281849d26705c30fc323 to your computer and use it in GitHub Desktop.
Open a File for Reading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.IO; | |
| using (var streamReader = File.OpenText("myfile.txt")) | |
| { | |
| string line = streamReader.ReadLine(); | |
| while (line != null) | |
| { | |
| Console.WriteLine(line); | |
| line = streamReader.ReadLine(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment