代码如下 | 复制代码 |
'以下为批量生成程序 if request("type") = "update" then%> <% set ru=server.createobject("adodb.recordset") sql="select * from news where id >= "&request("b_id")&" and id <= "&request("e_id")&" order by id desc" ru.open sql,conn,1 do while not ru.bof and not ru.eof %> <% okfile=fsow("../dnshow.html") file1=server.mappath("../html") dim newsfile if vartype(ru("file_name")) = 1 then newsfile = year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&""&ru("id")&".html" else newsfile = ru("file_name") end if file2=file1&""&newsfile id = ru("id") if vartype(ru("infotime")) = 1 then infotime = date() else infotime = ru("infotime") end if okfile = replace(okfile,"id",id) okfile = replace(okfile,"title",ru("title")) okfile = replace(okfile,"content",ru("content")) okfile = replace(okfile,"infotime",infotime) set fso = server.createobject("scripting.filesystemobject") set fout = fso.createtextfile(file2,true) fout.writeline okfile fout.close sql="update news set file_name = '"&newsfile&"',infotime = '"&infotime&"' where id = "&ru("id") conn.execute(sql) %> <%=file2%>生成成功....<br> <% |
时间: 2024-09-21 10:44:00