VB.net写文本文件
vb.net吧
全部回复
仅看楼主
level 3
魔婆之泪 楼主
每次打开文本文件,数据都会从第一行写入
我希望能追加到最新的一行。求指导[乖]
FileOpen(1,"C"\Data.txt",OpenMode.Output)
PrintLine(1,"测试文本")
FileClose(1)
2016年08月25日 12点08分 1
level 11
既然用了.net,就不要用这种vb6的老写法了。
直接用My.Computer.FileSystem.WriteAllText省事的多。
2016年08月25日 13点08分 2
level 1
将OUTPUT改为APPEND
2016年08月26日 03点08分 3
level 5
3楼正解
2016年08月26日 07点08分 4
level 3
filestream=new streamwriter("你要打开的文件名",true)
注意里面的参数true,表示追加写入
2016年08月27日 01点08分 5
level 2
5楼正解
2016年08月27日 14点08分 6
level 11
5楼的代码最好加上第三个参数,明确写文件的编码方式
2016年08月27日 15点08分 7
level 1
其实所谓的最后写跟全写是一样的,只不过封装功能而已
2016年09月15日 08点09分 8
level 7
欢迎加好友共同学习!603997262
2016年09月15日 14点09分 9
1