|
6#
楼主 |
发表于 2010-4-12 10:00:54
|
只看该作者
Sub CreateLog(message)
Const Forwriting=1
Const ForReading=2
Const ForAppending=8
Dim TextName
Dim fso
Dim FilePath
Dim text
Set fso=CreateObject("Scripting.FileSystemObject")
TextName="lims"&date
FilePath="E:\qtp脚本\物流系统\新建供应商\log\"&TextName&".txt"
If Not( fso.FileExists(FilePath) )Then
Set text= fso.CreateTextFile(FilePath,ForWriting,True)
else
Set text=fso.OpenTextFile(FilePath,ForAppending,false,true)
End If
text.WriteLine(date & " " & time & ": " & message)
text.Close
End Sub |
|