Private Sub Command1_Click() Dim i As Integer Dim max As Integer Dim a As Integer Open "E:\d3.txt" For Input As #1 Input #1, max For i = 2 To 10 Input #1, a If a > max Then max = a End If Next i Close #1 Text1 = max End Sub ________________________ i的作用是close#1,也就是i是关闭d3.txt用的。