Vb.net 如何在文本框中保存用户输入的值?
我有一个文本框,我想在它关闭后保存它,然后交给另一台计算机Vb.net 如何在文本框中保存用户输入的值?,vb.net,Vb.net,我有一个文本框,我想在它关闭后保存它,然后交给另一台计算机 Public Class Form1 Dim textBoxes() As TextBox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load textBoxes = New TextBox() {TextBox2} With My.Setting
Public Class Form1
Dim textBoxes() As TextBox
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
textBoxes = New TextBox() {TextBox2}
With My.Settings
If .TextBoxValues Is Nothing Then .TextBoxValues = New System.Collections.Specialized.StringCollection
For i = 0 To textBoxes.Length - 1
If .TextBoxValues.Count <= i Then .TextBoxValues.Add("")
textBoxes(i).Text = .TextBoxValues(i)
Next
End With
我认为您必须保存在txt文件、XML或其他文件中。
因为从另一方面讲,如何保持dtat类型化数据?:)
.TextBoxValues = New System.Collections.Specialized.StringCollection