建立一个通信录的随机文件phonBook.txt,内容包括姓名、电话、地址和邮编,用文本框输入数据。单击“添加主记录”按钮Command1时,将文本框数据写入文件,单击“显示”按钮Command2时,将文件中所有记录的内容显示在立即窗口。 Private Type PerData Name1 As String Phon As String * 11 Address As String * 10 PostCd As String * 6 End Type ______’定义PerData类型的变量xData’ Privat Sub Form_Load() Open"C:\phonBook.txt"For Random Asl End Sub Private Sub Command1_Click() xData.Name1=Text1.Text xData.Phon=Text2.Text ______=Text3.Text xData.PostCd=Text4.Text Putg#1,1,xData Text1.Text=" ":Text2.Text=" " Text1.3Text=" ":Text4.Text=" " End Sub Private Sub Command2_Click() reno=LOF(1)/Len(xData) i=1 D0 While i<=reno Get#1,i,xData Debug.Print xData,Name1,______,xData.Address,xData.PostCd i=i+1 LooP End Sub