鱼C论坛

 找回密码
 立即注册

写入txt文件的操作

已有 417 次阅读2012-12-20 16:21

dim fso
const forreading=1,forwriting=2,forappending=8
set fso=createobject("scripting.filesystemobject")
dim txtpath
txtpath="d:\log.txt"
fso.opentextfile txtpath,8,true
'call qtp_writetxt(txtpath,"woshi")
call qtp_writetxt2(txtpath,"1233")
public function qtp_writetxt(opath,words)
dim fso
set fso=createobject("scripting.filesystemobject")
set logfile=fso.opentextfile(opath,8,true)
logfile.writeline(cstr(words))
logfile.close
set logfile=nothing
set fso=nothing
end function
public function qtp_writetxt2(opath,words)
dim fso
set fso=createobject("scripting.filesystemobject")
set logfile=fso.opentextfile(opath,2,true)
logfile.writeline(cstr(words))
logfile.close
set logfile=nothing
set fso=nothing
end function

评论 (0 个评论)

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-10-14 03:12

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

返回顶部