QTP之创建text文件并写入内容

Dim fso,operfile

Const foreading = 1, forwriting = 2, forappending = 8

set fso = createobject("scripting.filesystemobject")

    if fso.fileexits("d:/ceshi.txt")  then

       fso.deletefile"d:/ceshi.txt"

    else

      end if

set openfile = fso.createtextfile("d:/ceshi.txt")

openfile.writeline("写入内容")

openfile.close

 

你可能感兴趣的:(text)