Last active
December 21, 2015 20:49
-
-
Save scorta/6363957 to your computer and use it in GitHub Desktop.
This file contains 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
// Compose a string that consists of three lines. | |
string lines = "First line.\r\nSecond line.\r\nThird line."; | |
// Write the string to a file. | |
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt"); | |
file.WriteLine(lines); | |
file.Close(); | |
//In order to append an existing file, set the Boolean parameter to true, as follows: | |
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt", true); | |
//Read from File | |
string allText = System.IO.Files.ReadAllText("C:\\test.txt"); | |
//There are some way to read from file (ReadAllText, ReadAllLines,..). You should check it yourself |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment