方法一:createtextfile生成文件方法 復制代碼 代碼如下:
<%function WriteToFile(FileName,FileContent)
set fso=server.createobject("scripting.filesystemobject")
set fp=fso.createtextfile(server.mappath(FileName),,True)
fp.write(FileContent)
end function%>
方法二:ADODB.Stream生成文件方法 復制代碼 代碼如下:
<%Function WriteToFile(FileName,FileContent)
Set ccObjStream = Server.CreateObject("ADODB.Stream")
With ccObjStream
.Type = 2
.Mode = 3
.Open
.Charset = "utf-8"
.Position = ccObjStream.Size
.WriteText FileContent
.SaveToFile FileName,2
.Close
End With
End Function%>