日期:2014-05-16 浏览次数:20861 次
Set fso = Server.CreateObject("Scripting.FileSystemObject")
qvoddir=server.mappath("/qvod/")
If not fso.folderexists(qvoddir) then
fso.createfolder(qvoddir)
Response.write "创建文件夹--"&qvoddir
End if
set myCache=new cache
myCache.name="qvodtemp"
set fr=fso.opentextfile(server.mappath("moban/qvod.htm"))
pencat=fr.readall
fr.close
myCache.add pencat,dateadd("h",3,Now)
pencat=replace(pencat,"{$title}",title)
Set fout = fso.CreateTextFile(server.mappath("/play/"&id&".htm"),true,1)
fout.Write pencat
fout.close
'*************************************************
'=使用说明:保存指定内容为UTF-8文件 file:相对绝对地址
'*************************************************
Sub Save_File(byval strbody,byval file)
On Error Resume Next
dim objstream
Set objstream = Server.Createobject("adodb.stream")
If err.number=-2147221005 Then
Response.Write "<script>alert('您的主机不支持adodb.stream!无法保存["&file&"]文件!');history.back();</div>"
err.clear
Set objstream = Noting
Exit Sub
response.end
End If
With objstream
.type = 2
.open
.charset = "utf-8"
.position = 0
.writetext = strbody
.savetofile server.mappath(file),2
.close
End With
Set objstream = Nothing
End Sub
//....省略
pencat=replace(pencat,"{$title}",title)
Call Save_File(pencat,"/play/"&id&".htm")
'Set fout = fso.CreateTextFile(server.mappath("/play/"&id&".htm"),true,1)
'fout.Write pencat
'fout.close