vb 2010 怎样把textbox1的文字添加到txt文件的最后一行
展开全部
Imports System.IO
Dim f As String = "C:\我的文件路径\文件.txt"
Dim fs As FileStream
Dim w As StreamWriter
Try
fs = New FileStream(f, FileMode.Append, FileAccess.Write)
w = New StreamWriter(fs)
w.WriteLine(TextBox1.Text)
w.Flush()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim f As String = "C:\我的文件路径\文件.txt"
Dim fs As FileStream
Dim w As StreamWriter
Try
fs = New FileStream(f, FileMode.Append, FileAccess.Write)
w = New StreamWriter(fs)
w.WriteLine(TextBox1.Text)
w.Flush()
Catch ex As Exception
MsgBox(ex.Message)
End Try
展开全部
Dim sw As StreamWriter = New StreamWriter("c:\abc.txt", True)
sw.WriteLine(TextBox1.Text)
sw.Flush()
sw.Close()
sw = Nothing
sw.WriteLine(TextBox1.Text)
sw.Flush()
sw.Close()
sw = Nothing
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
2010 就是.net了
更多追问追答
追问
哦,那你会解决我的问题吗?
追答
vb6.0的我就会,.net的不会
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询