Sub Main
'Open "E:/zhanglin/d/自动话测试/temp001.txt" For Output As #1
'Write #1, "张三", "初一年级", 14
'Write #1, "李四", "职业高中", 18
'Close #1
Dim name1 As String, nianji1 As String, age1 As Integer
dim msgtext as string
dim fname as string
fname=InputBox("Enter a filename to print:")
'Open "E:/zhanglin/d/自动话测试/temp001.txt" For Input As #1
Open fname For Input As #1
Do While Not Eof(1)
Input #1,name1, nianji1, age1
msgtext=msgtext &name1 & nianji1 & str(age1)
Loop
MsgBox msgtext
Close #1
' Kill "E:/zhanglin/d/自动话测试/temp001.txt"
'删除该文件
End Sub