运用
File.AppendAllText("c:\mytextfile.text","This is the first line") File.AppendAllText("c:\mytextfile.text","This is the second line")
如何将第二行文本显示在第一行下,就像我按下Enter键一样?这样做只需将第二行放在第一行旁边.
使用Environment.NewLine
File.AppendAllText("c:\mytextfile.text",Environment.NewLine + "This is the second line")
或者您可以使用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