Public Function GetLine(strFileName As String, strLine As Long) As String
On Error Resume Next
Dim intFileNum As Integer
Dim strCurrentLine As String
Dim strTemp As String
Dim arrayTemp() As String
'文件存在的函数就不在?里写了
If FileExists(strFileName) = False Then
'文件已?不存在
Exit Sub
End If
intFileNum = FreeFile
Open strFileName For Binary As #intFileNum
strTemp = Space(LOF(intFileNum))
Get intFileNum, , strTemp
Close #intFileNum
arrayTemp = Split(strTemp, vbCrLf)
If strLine <= UBound(arrayTemp) - 1 Then
GetLine = arrayTemp(strLine - 1)
Else
GetLine = ""
End If
End Function