vb 如何將LIST框中所有專案儲存到TXT框中,以及相反的如何讀取

  • 作者:由 匿名使用者 發表于 攝影
  • 2022-09-01

vb 如何將LIST框中所有專案儲存到TXT框中,以及相反的如何讀取將,愛情延續2008.11.05 回答

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

Top