Skip to content

Instantly share code, notes, and snippets.

@scorta
Last active December 21, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scorta/6363678 to your computer and use it in GitHub Desktop.
Save scorta/6363678 to your computer and use it in GitHub Desktop.
// Example #1
// Read the file as one string.
string text = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");
// Example #2
// Read each line of the file into a string array. Each element
// of the array is one line of the file.
string[] lines = System.IO.File.ReadAllLines(@"C:\Users\Public\TestFolder\WriteLines2.txt");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment