VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3330
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4785
   LinkTopic       =   "Form1"
   ScaleHeight     =   3330
   ScaleWidth      =   4785
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text2 
      Height          =   1095
      Left            =   600
      MultiLine       =   -1  'True
      TabIndex        =   3
      Top             =   1560
      Width           =   3855
   End
   Begin VB.TextBox Text1 
      Height          =   1215
      Left            =   600
      MultiLine       =   -1  'True
      TabIndex        =   2
      Top             =   120
      Width           =   3855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "显示"
      Height          =   495
      Left            =   2640
      TabIndex        =   1
      Top             =   2760
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "建立"
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   2760
      Width           =   975
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "P R I N T"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1200
      Left            =   240
      TabIndex        =   5
      Top             =   120
      Width           =   240
      WordWrap        =   -1  'True
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "W R I T E"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1200
      Left            =   240
      TabIndex        =   4
      Top             =   1560
      Width           =   240
      WordWrap        =   -1  'True
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
  Dim name$, spe$, age%
  Open "c:\t1.txt" For Output As #1
  Open "c:\t2.txt" For Output As #2
  For i = 1 To 3
    name = InputBox("输入姓名" & i)
    spe = InputBox("输入" & name & "的专业")
    age = InputBox("输入" & name & "的年龄")
    Print #1, name, spe, age
    Write #2, name, spe, age
  Next i
  Close #1, #2
End Sub

Private Sub Command2_Click()
  Dim s
  Open "c:\t1.txt" For Input As #11
  Open "c:\t2.txt" For Input As #22
  Text1 = ""
  Text2 = ""
   Do While Not EOF(11)
     Line Input #11, st
     Text1 = Text1 & st & vbCrLf
  Loop
  Do While Not EOF(22)
     Line Input #22, st
     Text2 = Text2 & st & vbCrLf
  Loop
  Close #11, #22
End Sub
