使用
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", "This is the first line")
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
关于vb.net - 如何使用VB.Net转到文本文档中的新行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10095155/