第1个回答 2009-05-18
Private Sub Form_click()
Print ReadSomeLine("z:\1.txt", 3)
End Sub
Function ReadSomeLine(Str1 As String, LineN As Integer)
Dim temp As String
Dim a() As Variant, x As Integer
Open Str1 For Input As #1
Do While Not EOF(1)
Line Input #1, temp
ReDim Preserve a(x)
a(x) = temp
x = x + 1
Loop
Close #1
ReadSomeLine = a(LineN - 1)
End Function本回答被提问者采纳