function test(byval file) as boolean
dim fso as object
set fso=createobject("scripting.filesystemobject")
file=file
if fso.fileexists(file) then
if fso.getfile(file).size>0 then
read=fso.opentextfile(file).readall
if right(read,2)=vbcrlf then
test=-1
else
test=0
end if
end if
end if
end function
'调用方法
'if test("1.txt") then
'有回车
'else
'没有回车
'end if
温馨提示:答案为网友推荐,仅供参考