[求助]谁有用vb编写的简易通讯录源码?
谁有用vb编写的简易通讯录源码?给我发一份!hustdh@或者将源码贴在论坛上面也可!
我也想要啊
Private Sub Form_Load()
Dim tpStr As String, i As Integer
fileName = App.Path & "\data.txt"
If Dir(fileName) <> "" Then
'加载数据
Open fileName For Input As #1
Do While Not EOF(1)
With ListView1.ListItems.Add()
For i = 0 To 4
Line Input #1, tpStr
If i = 0 Then
.Text = tpStr
Else
.SubItems(i) = tpStr
End If
Next i
End With
Loop
Close #1
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
Dim tpList As ListItem
'保存数据
Open fileName For Output As #1
For Each tpList In ListView1.ListItems
Print #1, tpList.Text
For i = 1 To 4
Print #1, tpList.SubItems(i)
Next i
Next tpList
Close #1
End Sub