标签:
‘创建日志文件并在该文件里添加内容
Sub writelog(log)
Const forreading =1,forwriting =2,foraddpending=8
Dim fso,f
Dim filepath
filepath ="C:\log\log.txt"
Set fso =createobject("scripting.filesystemobject")
If fso.FileExists(filepath) = false Then
Set f = fso.CreateTextFile(filepath)
End If
Set f =fso.OpenTextFile(filepath,foraddpending,false)
f.Write(vbcrlf&log)
f.Close
Set fso =nothing
End Sub
标签:
原文地址:http://www.cnblogs.com/aliceluo/p/5585741.html