不是因为有些事情难以做到,我们才失去自信,而是我们失去了自信,这些事情才难以做到!

写日志方法

上一篇 / 下一篇  2010-03-28 18:25:10 / 个人分类:功能测试

R Kyxn3E.w1s0此方法太有用了,是网友给我无偿提供的,我在此共享,希望让更多的人分享Dim WshShell
b.^!~ Nq7o0B/^&@0Dim fso,file
3]@J'K*n#P)\#Z/K0charNumber1=20
C+FZYkI0Const ForReading = 151Testing软件测试网{D5rK9x[l
Const ForWritting = 2
_ q&x'Ck[7B:z ~`0Const ForAppending = 8
E3Fvc7x+z Ni0M0operateKind=ForAppending51Testing软件测试网 F/O0U&_J
'nowTime=date()&"-"&hour(now())&"-"&minute(now())&"-"&second(now())51Testing软件测试网5xD,o)B0Pg!o;D
nowTime=date()51Testing软件测试网;D(D9C-Vk1R:\w

51Testing软件测试网M K,J3TUW

Set WshShell = CreateObject("WScript.Shell")
#}h8W%W*h+D`0CurrentDirectory=WshShell.CurrentDirectory51Testing软件测试网2~gDyX
filePath=CurrentDirectory

L,MF8zA;y3}1ms ZJ0

D0en.@y^2d O%V0Set fso=CreateObject("scripting.FileSystemObject")
9p/\.M m aHf)L S+@a F0Set file=fso.openTextFile(filePath&"\"&nowTime&".txt",operateKind,True)51Testing软件测试网b0Qf m'`x`/t
 file.writeline now()
vfJ.j@4f0 file.writeline "你要生成的错误日志,这段话可以参数化为你的错误内容啦"51Testing软件测试网6p \0\VG\:AJ

7Fn*NJ1jTK,f#u0file.close
!V8@|R Ed0Set file=nothing
9M2} ?@K;y/f0set fso=nothing

evyy4L+F)]0

TAG:

 

评分:0

我来说两句

Open Toolbar