“使用fso写文件某一行的函数”的ASP编程代码是什么

renwenyishuadmin 提交于 周三, 2018/06/13 - 03:35
分类

“使用fso写文件某一行的函数”的ASP编程代码是:

function fsolinewrite(filename,linenum,linecontent)

if linenum < 1 then exit function

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

temparray = split(tempcnt,chr(13)&chr(10))

if linenum>ubound(temparray)+1 then

exit function

else

temparray(linenum-1) = linecontent

end if

tempcnt = join(temparray,chr(13)&chr(10))

set f = fso.createtextfile(server.mappath(filename),true)

f.write tempcnt

end if

f.close

set f = nothing

end function

第三种存在 从通用智能到超级智能 朱嘉明 著 经济 deepseek 对话时代 元宇宙与数字经济 历史不会熔断 AI时代生存手册

【推荐理由】历史热推

【到手价】29.90元