vb 如何將LIST框中所有專案儲存到TXT框中,以及相反的如何讀取
- 2022-09-01
Private Sub Command1_Click()
Dim i As Integer
Open “abc。txt” For Output As #1
For i = 0 To List1。ListCount - 1
Print #1, List1。List(i)
Next
Close #1
End Sub
Private Sub Command2_Click()
Dim linestr As String
Open “abc。txt” For Input As #1
Do While Not EOF(1)
Line Input #1, linestr
List2。AddItem linestr
Loop
Close
End Sub