Sub CreateFile(filename,filetext)
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile(Server.MapPath(filename), True)
tf.WriteLine(filetext)
set tf=nothing
set fso=nothing
End Sub
调用方式
filename=replace(date(),"-","")&replace(time(),":","")&".shtml"
call CreateFile(replace(date(),"-","")&"/"&filename,htmltext)