代码如下:
<%@ codepage="936" %>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</HEAD>
<!--#include file="../Include/Conn.asp"-->
<!--#include file="../Include/Replacer.asp"-->
<%
if request("gx")=1 then
min=request("min")
max=request("max")
if min="" and max="" then mysql=" order by id desc"
if min<>"" and max="" then mysql=" where id>="&min&" order by id desc"
if min="" and max<>"" then mysql=" where id<="&max&" order by id desc"
if min<>"" and max<>"" then mysql=" where id>="&min&" and id<="&max&" order by id desc"
'生成网址HTML页面
set fso = Server.CreateObject("Scripting.FileSystemObject")
set Rslist=server.createobject("adodb.recordset")
sql="SELECT * FROM news "&mysql
Rslist.open sql,conn,1,1
i=0
while not Rslist.eof
set fw = fso.CreateTextFile(Server.MapPath("../../htmlwenzhang/wenzhang_"&Rslist(0)&".htm"),TRUE) '若有则覆盖
'------------------------------------------------------------------------------------------
FTitle = Rslist("FTitle")
STitle = Rslist("STitle")
iTime = Rslist("Time")
Author = Rslist("Author")
Part = Rslist("Part")
Content = Rslist("Content")
ImgPath = Rslist("ImgPath")
SImgPath = Rslist("SImgPath")
fw.writeline("<html><head><meta http-equiv='Content-Language' content='zh-cn'><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><Meta name='Kyewords' Content=会'><title>"&FTitle&"|交友文章|</title><link href='../syccss.css' rel='stylesheet' type='text/css'></head><body bgcolor='#ffffff' background='../image/footerbg.gif'><div align='center'><script language='javascript' src='../js/header2.js'></script></div><div align='center'><table border='0' width='846' id='table2' height='698' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'><tr><td height='1'></td></tr><tr><td align='right' valign='top' width='846'><table width='98%' border='0' cellpadding='0' cellspacing='0' id='table49'><tr><td class='bian_4lianghui' height='6' align='center'></td></tr><tr><td class='bian_4lianghui'><table align='center' border='0' cellspacing='0' cellpadding='0' width='98%' id='table50'><tr><td align='center' class='bian_4lianghui'>")
If FTitle <> "" Then
fw.writeline("<strong><font size='4'><div align='center'>"&FTitle&"</div></font></strong>")
End If
If STitle <> "" Then
fw.writeline("<strong><font size='2'><div align='center'>"&STitle&"</div></font></strong>")
End If
If iTime <> "" Then
fw.writeline("<div align='right'>发布时间:"&iTime&"</div>")
End If
If Content <> "" Then
fw.writeline("<script type='text/javascript'><!--")
fw.writeline("google_ad_client = 'pub-9918668709346760';")
fw.writeline("/* 728x90, 创建于 08-5-18 */")
fw.writeline("google_ad_slot = '6299714706';")
fw.writeline("google_ad_width = 728;")
fw.writeline("google_ad_height = 90;")
fw.writeline("//-->")
fw.writeline("</script>")
fw.writeline("<script type='text/javascript'")
fw.writeline("src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>")
fw.writeline("</script>")
fw.writeline("<script src='http://busjs.vodone.cn/bus/ownerjs/advjs_36/36372/36372_91368_p7_.js'></script>")
fw.writeline("<div align='left'>"&TReplaceSinger(Content)&"</div>")
End If
If Part <>"" Then
fw.writeline("<div align='right'>摘自:"&Part&"</div>")
End If
If Author <> "" Then
fw.writeline("<div align='right'>作者:"&Author&"</div>")
End If
fw.writeline("<div align='center'>")
fw.writeline("<script type='text/javascript'><!--")
fw.writeline("google_ad_client = 'pub-9918668709346760';")
fw.writeline("/* 728x90, 创建于 08-5-18 */")
fw.writeline("google_ad_slot = '6299714706';")
fw.writeline("google_ad_width = 728;")
fw.writeline("google_ad_height = 90;")
fw.writeline("//-->")
fw.writeline("</script>")
fw.writeline("<script type='text/javascript'")
fw.writeline("src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>")
fw.writeline("</script>")
fw.writeline("<a href='#' onClick='javascript:window.close();' class='line_t'>[ 关 闭 ]</a></div>")
fw.writeline("<script>document.write('<iframe src=http://code.linkpage.cn/i.html?id=89998&title='+document.title+' marginheight=0 marginwidth=0 frameborder=0 scrolling=no height=241 width=575 ></iframe>');</script></td></tr></table>")
fw.writeline("</td></tr></table></td></tr></table></td></tr></table><script language='javascript' src='../js/end2.js'></script></div></body></html>")
'------------------------------------------------------------------------------------------
fw.close
Rslist.movenext
wend
Rslist.close
set Rslist=nothing
conn.close
set conn=nothing
%>
<p align="center"> </p>
<p align="center"> </p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="1" width="350" bgcolor="#FF0000" height="150">
<tr>
<td bgcolor="#F1E3F2">
<p align="center">文章完成</p>
</td>
</tr>
</table>
</center>
</div>
<%else%>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="1" width="450" bgcolor="#FF0000">
<tr>
<td bgcolor="#F1E3F2">
<p align="center" style="margin-top: 16">!文章生成!</p>
<FORM name=form1 action=creatshowenzhang.asp?gx=1 method=post>
<p align="center" style="margin-top: 16">从ID:<input type="text" name="min" size="20" value="1"></p>
<p align="center" style="margin-top: 16">自ID:<input type="text" name="max" size="20" value="400"></p>
<p align="center" style="margin-top: 16"><input type="submit" value="提 交" name="B1">
<input type="reset" value="重写" name="B2"></p>
</form>
<p align="center"> </td>
</tr>
</table>
</center>
</div>
<%
conn.close
set conn=nothing
end if%>