数码资讯
使用ASP实现读取文件最后一行的代码。
复制代码代码如下所示: 功能fsolastline(文件名) 昏暗的FSO,F,temparray,tempcnt 设置FSO = server.createobject(脚本。FileSystemObject ) 如果不fso.fileexists(server.mappath(文件名))然后退出
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
复制代码代码如下所示:
功能fsolastline(文件名)
昏暗的FSO,F,temparray,tempcnt
设置FSO = server.createobject(脚本。FileSystemObject )
如果不fso.fileexists(server.mappath(文件名))然后退出功能
集F = fso.opentextfile(server.mappath(文件名),1)
如果不f.atendofstream然后
tempcnt = f.readall
f.close
设置f =无
temparray =分裂(tempcnt,CHR(13)CHR(10))
fsolastline = temparray(UBound(temparray))
最后如果
端功能
功能fsolastline(文件名)
昏暗的FSO,F,temparray,tempcnt
设置FSO = server.createobject(脚本。FileSystemObject )
如果不fso.fileexists(server.mappath(文件名))然后退出功能
集F = fso.opentextfile(server.mappath(文件名),1)
如果不f.atendofstream然后
tempcnt = f.readall
f.close
设置f =无
temparray =分裂(tempcnt,CHR(13)CHR(10))
fsolastline = temparray(UBound(temparray))
最后如果
端功能
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。