展开全部
Dim filename As String
filename = "D:\txt\111.txt"
Dim sw As StreamWriter = New StreamWriter(filename)
Dim str As String = "abc"
sw.WriteLine(str )
sw.Close()
追问
怎么把form1的结果保存到文本文件里哦。。。。
追答
str是相当于是这个结果的,就是多写一行代码而已。
Dim str As String = "Hi friends"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label3.Text = str
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim filename As String
filename = "D:\txt\111.txt"
Dim sw As StreamWriter = New StreamWriter(filename)
sw.WriteLine(str )
sw.Close()
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询