Public Function OpenFile(Fname)
whichfile=server.mappath(Fname)
Set fso = CreateObject("scripting.FileSystemObject")
if fso.fileExists(whichfile) then
Set txt = fso.OpenTextFile(whichfile,1,true)
if not txt.atendofstream then
rline=txt.ReadAll
else
rline=""
end if
OpenFile=rline
txt.Close
end if
Set fso = Nothing
END Function
Public Function SaveFile(Content, Fname)
dim objfso,objts,allLines,result
set objfso=server.createobject("scripting.filesystemobject") ’建立FSO对象
set objts=objfso.opentextfile(server.mappath(Fname),2,true) ’打开文件,如果不存在,就新建
objts.write Content
objts.close ’关闭打开的文件
set objts=nothing
set objfso=nothing
END Function
dim str
str=OpenFile("txt.txt")
str=rePlace(Str,vbCrlf,"")
response.Write str
SaveFile str,"cur.txt"
热门信息
阅读 (126)
1 ASP+AJAX实现分页效果[Z]阅读 (125)
2 ASP 微信公共平台接口实现代码阅读 (118)
3 [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法阅读 (118)
4 提高IIS+ASP网站安全性的方法阅读 (118)
5 用ASP删除文件