' 创建
日志文件
51Testing软件测试网2OO4Ob$D6w]@w1\JSub createLogTxt(message)
51Testing软件测试网+ywU5[#IOn Error Resume Next
T#tV7f2l!b/PW0 Dim fso,logFile,fileSpec,testName
51Testing软件测试网)Qy2P J7ez[2H Const ForReading = 1, ForWriting = 2, ForAppending = 8
/[
pi0}-aOn!T0 testName = "new_message" & date
51Testing软件测试网)vi[;e!g Set fso=CreateObject("scrīpting.FileSystemObject")
]]} _)vp~]Z)N0 fileSpec="D:\" & testName &".txt"
U-a5raR:yBM0 If Not(fso.FileExists(fileSpec)) Then
51Testing软件测试网.lL;Tb!q b Set logFile=fso.CreateTextFile(fileSpec,ForWriting,True)
51Testing软件测试网}D/^*o9j$g
s$m logFile.WriteLine("#######################################################################")
51Testing软件测试网"EZB`zKkmLg6C logFile.WriteLine(Date & " " & Time & "
Test: " & environment.Value("TestName"))
z%G;EZYT'c'p0 logFile.WriteLine("#######################################################################")
G)`WTKp`:sZmM0 logFile.Close
51Testing软件测试网v;@V7W0o!Wg5sR [ Set logFile=Nothing
S.c+z(~8z%`&y\0 End If
51Testing软件测试网8\{3`2Q4]#WV{1L '写日志
r0~JB W&?R/W0^,P6Z0 Set logFile = fso.OpenTextFile(fileSpec,ForAppending, False, True)
51Testing软件测试网
V,A#DsLX&C1s logFile.WriteLine (date & " " & time & ": " & message)
51Testing软件测试网~.Q.o"w R%bV#E#[ logFile.Close
51Testing软件测试网f&}([s:p$x Set logFile = Nothing
51Testing软件测试网[#`e(i C Set fso = Nothing
T"XI
W7Lpio:h9cZh0 On Error Goto 0
51Testing软件测试网6x1yyRc*UHS+iEnd Sub