【Asp】Asp读取文本文件最后一行的函数

admin 2021年4月3日19:03:03评论86 views字数 667阅读2分13秒阅读模式

Asp读取文本文件最后一行的函数:

Function getLastLine(fileName)
 Dim fso,srcFileContent,tempLine
 ForReading = 1
 FileName = Server.MapPath(FileName)
 Set fso = CreateObject("Scripting.FileSystemObject")
  If fso.FileExists(fileName) Then  
  Set srcFile = fso.OpenTextFile(fileName, ForReading)
  While Not srcFile.AtEndOfStream 
   tempLine = srcFile.ReadLine
  Wend
  Set srcFile = Nothing
  Set fso = Nothing
  getLastLine = tempLine
 Else
  getLastLine = "file not exists" '当文件不存在时返回此错误
 End If 
End Function

文章来源于lcx.cc:【Asp】Asp读取文本文件最后一行的函数

相关推荐: 建站之星 SiteStar V2.0 本地包含漏洞

这是一个老漏洞了,临时有用,拿来收集下,说不定以后有用…… 转载于:http://www.llsilver.com/invasion/hole/sitestar-v2-0-0day.html 建站之星 SiteStar V2.0 漏洞由大牛云集的t00ls会员…

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月3日19:03:03
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【Asp】Asp读取文本文件最后一行的函数https://cn-sec.com/archives/319720.html

发表评论

匿名网友 填写信息