Using
File.AppendAllText("c:\mytextfile.text", "This is the first line")
File.AppendAllText("c:\mytextfile.text", "This is the second line")
How do I make the second line of text appear under the first one, as if I hit the Enter key? Doing it this way simply puts the second line right next to the first line.
Using Environment.NewLine
File.AppendAllText("c:\mytextfile.text", "This is the first line")
File.AppendAllText("c:\mytextfile.text", Environment.NewLine + "This is the second line")
Or you can use the StreamWriter
Using writer As new StreamWriter("mytextfile.text", true)
writer.WriteLine("This is the first line")
writer.WriteLine("This is the second line")
End Using
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With