右边listbox里显示firstname,如果点它就会出现所有信息
2,也可以利用e-mail地址找到想找的人的信息。
3,那几个按钮都要用到
4。在各个列表中填写资料后点那个add new,然后蹦出一个messagebox提示已经添加
5。listbox中就会列有各个添加的FIRSTname
6。最好用的方法是input output和structures
7。最下面是学习是用的一些代码(以下代码使用环境是在VB2008中,如果提供6.0中使用的代码应该也可以。。。能用2008做升级)
8。高分速求
9。做得好追加分数
Public Class Form1
'declare a file name to save thedata
Const myfile As String = "personalInfo.txt"
Private Sub btnWrite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
'open the file
FileOpen(1, myfile, OpenMode.Output)
'write th data
Print(1, txtData.Text)
'close the file
MessageBox.Show("data is written in the file")
FileClose(1)
End Sub
Private Sub btnInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput.Click
'declare a variable to read the data
Dim words As String = ""
'open the file to read the data
FileOpen(1, myfile, OpenMode.Input)
'read the data
Do Until EOF(1)
Input(1, words)
txtData.Text &= words & vbCrLf
Loop
'close the file
FileClose(1)
MessageBox.Show("all data was read", "input data from file")
End Sub
Private Sub btnAppend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAppend.Click
If System.IO.File.Exists(myfile) Then
FileOpen(1, myfile, OpenMode.Append)
PrintLine(1, txtData.Text)
FileClose(1)
MessageBox.Show("append the data to the file", "file append")
Else
'open the file
FileOpen(1, myfile, OpenMode.Output)
'write th data
PrintLine(1, txtData.Text)
'close the file
MessageBox.Show("data is written in the file")
FileClose(1)
End If
End Sub
End Class