28,390
社区成员
发帖
与我相关
我的任务
分享
<%'以下为批量生成程序
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>
<%
ru.movenext
loop
%><%end if%>