方法一: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%>
如对本文有疑问,
点击进行留言回复!!
网友评论