|
耶,这样就强壮了
Function read_line(pathway, rowcount)
Dim fso,myfile,i,flag
flag = 1
Set fso=CreateObject("scripting.FileSystemObject")
If fso.FileExists(pathway) then
Set myfile = fso.openTextFile(pathway,1,false)
Else
flag = 0
End If
For i=1 to rowcount-1
If Not myfile.AtEndOfLine Then
myfile.SkipLine
End If
Next
If flag = 1 then
If Not myfile.AtEndOfLine Then
read_line = myfile.ReadLine
Else
read_line = "文本越界"
End If
myfile.close
Else
read_line = "文件不存在"
End If
End Function |
|