以下程序主要是Put #1, 4, Pal中的4不太懂还有Put #1, 5, Pal中的5。还这句话中的最后那个连接的VBcrlf是什么?Txt1.Text = Txt1.Text & Pal.Name & Pal.Tel & Pal.Post & vbCrLf
Private Type PalInfo
Name As String * 8
Tel As String * 10
Post As Long
End Type
Dim Pal As PalInfo
Private Sub Cmd1_Click()
Open App.Path & "\dr191.dat" For Random As #1 Len = Len(Pal)
Pal.Name = "Zhangnan"
Pal.Tel = "66666666"
Pal.Post = 100042
Put #1, 4, Pal
Pal.Name = "Wangjie"
Pal.Tel = "88888888"
Pal.Post = 100037
Put #1, 5, Pal
Close #1
End Sub
Private Sub Cmd2_Click()
Txt1.Text = ""
Open App.Path & "\dr191.dat" For Random As #1 Len = Len(Pal)
While Not EOF(1)
Get #1, , Pal
Txt1.Text = Txt1.Text & Pal.Name & Pal.Tel & Pal.Post & vbCrLf
Wend
Close #1
End Sub