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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章