On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\11.txt", 1)
Do While True
If 1 Then
lines = objfile.ReadLine
If Err.Number <> 0 Then
WScript.Echo "#"&Err.Number&Space (5)&"lines="&m
Err.Clear
Exit Do
End If
m=m+1
End If
Loop
Set objfso = nothing
[ Last edited by joyn on 2008-6-3 at 09:03 PM ]作者: sonicandy 时间: 2008-6-18 21:56 set fso = createobject("scripting.filesystemobject")
set stream = fso.opentextfile("d:\11.txt",1,false)
if not stream.atendofstream then
content = stream.readall()
linecount = ubound(split(content,vbcrlf)) + 1
else
linecount = 0
end if
call stream.close
call msgbox(linecount)
[ Last edited by sonicandy on 2008-6-18 at 09:59 PM ]