如何使用VB.Net转到文本文档中的新行

前端之家收集整理的这篇文章主要介绍了如何使用VB.Net转到文本文档中的新行前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
运用
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

猜你在找的VB相关文章