生成文件类

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)

你可能感兴趣的:(文件)