VB.net 如何将一些文本框文本保存到文本文件中 [英] VB.net How to save a few Textbox text into a text files
本文介绍了VB.net 如何将一些文本框文本保存到文本文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将一些文本框保存到一个文本文件中
看图片
我可以合并文本框中的文本并保存吗?
i want to save a few textbox into a text file
See Picture
Can I combine text from the textbox and save it ?
推荐答案
您可以使用下面提供的示例代码
You can use the sample code provided below
Dim filepath As String = IO.Path.Combine("D:\", "somefile.txt") 'Some file path
Using sw As New StreamWriter(filepath)
sw.Write(TextBox1.Text)
sw.WriteLine(" " & TextBox2.Text)
sw.Write(TextBox3.Text)
sw.WriteLine(" " & TextBox4.Text)
'
'and so on
'
End Using
这篇关于VB.net 如何将一些文本框文本保存到文本文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文