论坛风格切换
您好,欢迎光临本站!   登录 注册新用户
  • 2978阅读
  • 0回复

[asp]用asp实现读取文件的最后一行的代码 [复制链接]

上一主题 下一主题
 

发帖
16250
黑豆
-2
威望
45224
贡献值
2
交易币
0
红豆
0
只看楼主 倒序阅读 0 发表于: 2013-11-24
asp 读文件最后一行的函数代码


复制代码代码如下:

function FSOlastline(filename)
dim fso,f,temparray,tempcnt
set fso = server.CreateObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
set f = nothing
temparray = split(tempcnt,chr(13)&chr(10))
FSOlastline = temparray(ubound(temparray))
end if
end function


快速回复
限100 字节
 
上一个 下一个