QTP_Text Create

来源:互联网 发布:做金融网络销售怎么样 编辑:程序博客网 时间:2024/04/29 12:41

'Core points of this execise:

'1. Delete file

'2. Write line


Option Explicit

Dim fso,fil, filpath


Dim filename
filename="c:\testfile.txt"


Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(filename) Then
 fso.DeleteFile(filename)
End If

   Set fil = fso.CreateTextFile(filename, True)
 fil.WriteLine("This is a test.")


  fil.Close 


  'Release
  Set fil=Nothing

  Set fso=Nothing

原创粉丝点击