用asp实现读取文件的最后一行的代码

来源:asp之家 时间:2011-03-08 10:55:00 

代码如下:


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 

标签:文件,最后一行
0
投稿

猜你喜欢

  • 也谈谈DIV+CSS的牛角尖

    2007-11-16 16:12:00
  • 一行CSS代码为网站加上奥运主题

    2008-07-20 12:33:00
  • 小程序开发之uniapp引入iconfont图标以及使用方式

    2024-04-22 13:09:05
  • Python生命游戏实现原理及过程解析(附源代码)

    2023-07-16 18:02:13
  • javascript禁用Tab键脚本实例

    2023-10-13 10:53:58
  • Python 列表的基本操作介绍

    2021-09-09 08:13:34
  • python删除列表中特定元素的几种方法

    2023-12-21 02:17:12
  • asp如何用Jmail组件的发送电子邮件?

    2010-06-12 12:51:00
  • js实现股票实时刷新数据案例

    2024-04-10 10:52:20
  • vue-loader和webpack项目配置及npm错误问题的解决

    2024-04-29 13:10:33
  • Python编程实现简单的微博自动点赞

    2021-05-14 06:43:12
  • 通过PHP current函数获取未知字符键名数组第一个元素的值

    2023-11-15 04:52:07
  • Python调用百度AI实现图片上文字识别功能实例

    2022-07-27 11:02:44
  • python通过colorama模块在控制台输出彩色文字的方法

    2023-07-23 00:35:51
  • python爬虫正则表达式之处理换行符

    2021-02-20 05:56:02
  • Python2和Python3中print的用法示例总结

    2022-07-19 02:27:58
  • 使用sp_xml_preparedocument处理XML文档的方法

    2011-09-30 11:56:15
  • python爬虫selenium和phantomJs使用方法解析

    2023-02-06 19:23:38
  • 如何把ASP源代码编写成DLL组件

    2007-10-19 13:49:00
  • Python恋爱小助手之必拿下

    2023-09-22 13:09:00
  • asp之家 网络编程 m.aspxhome.com