ASP自动生成HTM文件???

huhanshan013 2004-01-19 03:01:38
帮我看看这个文件,如何生成网页的?
最后能生成,但是格式如何写进去的?里面全部是读取数据库,没有地方说出位置如何放阿?不能上传文件,就把源码全部拷贝过来了--》

<%Admin="DownAdd"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_down.asp"-->
<!--#include file="config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>批量生成HTML</title>
<style>
body{font-size:9pt;line-height:140%}
</style>
</head>
<body>
<%
set rs=server.createobject("adodb.recordset")
rs.open ("select down_show from mb"),conn,1,1
pencat=rs("down_show")
rs.close
rs.open ("select * from down where id="&request("id")&""),conn,1,1
if not rs.eof then
ttid=rs("tid")
id=rs("id")
cxn=rs("cxn")
cxv=rs("cxv")
pwd=rs("pwd")
yy=rs("yy")
cd=rs("cd")
sq=rs("sq")
size=rs("size")
hot=rs("hot")
system=rs("system")
reg=rs("reg")
ln=rs("ln")
lu=rs("lu")
pic=rs("pic")
body=rs("body")
datetime=rs("date")
hits=rs("hits")
show=rs("show")
user=rs("user")
gs=rs("gs")
end if
rs.close

user="<a href='javascript:' onclick='window.open(""../admin/user.asp?user="&user&""","""",""width=400,height=150,resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no"")'>"&user&"</a>"

'################ 读取标题 等.. 开始 ################
rs.open "select * from downtype where id="&ttid,conn,1,1
ts=rs("ts")
TN=split(rs("tname"),"|")
TI=split(rs("ts"), ",")
for i = 0 to ubound(TN)-1
if i=ubound(TN)-2 and ubound(TN)>1 then
TTY_id=TI(i)
TTY_name=TN(i)
end if
all_type_top_id=TI(i)
all_type_name=TN(i)
thistype=thistype & "-> <a href=""../sort/"&TI(i)&"_1.htm"">"&TN(i)&"</a>"
thistitle=thistitle & " - "&TN(i)&""
ttype=TN(i)
next
rs.close
''########读取本类top10
sql="select * from down where tid="&ttid&" order by hits desc"
rs.open sql,conn,1,1
if rs.eof then
txtop="·还没有下载"
else
do while not rs.eof
h=h+1
txtop=TXtop&"·<a href=""../soft/"&rs("id")&".htm"">"&rs("cxn")&" "&rs("cxv")&"</a><br>"
if h>=10 then exit do
rs.movenext
loop
h=0
end if
rs.close
'########读取下载连接
sql="select * from downfile where downid="&id&" order by downno"
rs.open sql,conn,1,1
if not rs.eof then
if gs=1 or gs=2 or gs=3 then
dlist=dlist&"<img src=../images/play_"&gs&".gif width=16 height=16> "
else
dlist=dlist&"<script language=""javascript"">function JyDownH(htmlurl){var newwin=window.open(htmlurl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');return false;}</script>"
end if
do while not rs.eof
pi=pi+1
if gs=1 or gs=2 or gs=3 then
dlist=dlist&"<a target=""_self"" href=""javascript:"" onClick=""window.open('../play.asp?id="&id&"&no="&rs("downno")&"','','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=368,height=285,status=no,resizable=no')"">["&pi&"]</a>"
else
dlist=dlist&"<a href=""../down.asp?id="&id&"&no="&rs("downno")&""" onclick=""return JyDownH(this.href);""><img border=0 src=../images/d_download.gif width=14 height=14>点这里下载-> "
if rs("filename")<>"" then
dlist=dlist&""&rs("filename")&""
else
dlist=dlist&""&cxn&" "&cxv&""
end if
dlist=dlist&"</a><br>"
end if
rs.movenext
loop
end if
rs.close
'#######读取相关软件
sql="select top 10 id,cxn,cxv from down where cxn like '%"&cxn&"%' and id<>"&id&" order by date desc"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
xlist=xlist&"·<a href="""&rs("id")&".htm"">"&rs("cxn")&""
if rs("cxv")<>"" then
xlist=xlist&" "&rs("cxv")&""
end if
xlist=xlist&"</a><br>"
h=h+1
if h>=10 then exit do
rs.movenext
loop
h=0
xlist=xlist&"·更多相关 <a href=""../search.asp?k="&cxn&""">GO!-></a><br><br>"
end if
rs.close
conn.close
set conn=nothing
%><!--#include file="mdb_path_info.asp"--><%
'#######读取相关文章
sql="select top 10 id,title from info where title like '%"&left(cxn,5)&"%' or se='"&cxn&"' order by date desc"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
xinfo=xinfo&"·<a target=""_blank"" href=""../info/"&rs("id")&".htm"">"&rs("title")&"</a><br>"
h=h+1
if h>=10 then exit do
rs.movenext
loop
h=0
end if
rs.close
set rs=nothing
conn.close
set conn=nothing

pencat=replace(pencat,"S_CXN",cxn)
pencat=replace(pencat,"S_CXV",cxv)
pencat=replace(pencat,"S_ID",id)

if yy<>"" then
else
yy="未知"
end if
pencat=replace(pencat,"S_YY",yy)

if cd<>"" then
else
cd="未知"
end if
pencat=replace(pencat,"S_CD",cd)

if sq<>"" then
sq=sq&"版"
else
sq="授权未知"
end if
pencat=replace(pencat,"S_SQ",sq)

if size<>"" then
else
size="未知"
end if
pencat=replace(pencat,"S_SIZE",size)

for i=1 to hot
hotstar=hotstar&"<img src=""../images/d_star.gif"" width=""13"" height=""12"" border=""0"">"
next
'''###############注册页面
if reg<>"" then
hotstar=hotstar&"<br><b>在线注册:</b><a href="""®&""" target=""_blank""><font color=""red"">点击这里成为正版用户</font>==></a>"
end if
'''###############
pencat=replace(pencat,"S_HOT",hotstar)
if system<>"" then
else
system="未知"
end if
pencat=replace(pencat,"S_SYSTEM",system)
if ln<>"" then
ln="<a href=""mailto:"&ln&"?subject=Come from "&weburl&",About yours ["&cxn&"]"">"&ln&"</a>"
else
ln="未知"
end if
pencat=replace(pencat,"S_EMAIL",ln)

if lu<>"" then
lu="<a href="""&lu&""" target=""_blank"">"&lu&"</a>"
else
lu="未知"
end if
pencat=replace(pencat,"S_URL",lu)
if pic<>"" then
pic="<br><a href='javascript:' onclick='window.open(""about:<body topmargin=0 leftmargin=0 oncontextmenu=self.event.returnValue=false><img%20alt="&webname&"["&weburl&"]%20-%20共享软件发布-下载-学习-研究-交流-破解-注册-汉化-尽在"&webname&"-ASP江湖-注册版-破解版-汉化版-程序制作:百万网址.惊云--%20src="&pic&">"","""",""width=600,height=400,resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no,location=no"")'><img border=""0"" alt=""点击查看图片"" src="""&pic&""" width=""95"" height=""75""></a>"
else
pic=""
end if
pencat=replace(pencat,"S_PIC",pic)
pencat=replace(pencat,"S_TXT",body)
pencat=replace(pencat,"S_DATE",datetime)
if datetime>Now() then
mtime=datetime
else
mtime=Now()
end if
pencat=replace(pencat,"S_TIME",mtime)
pencat=replace(pencat,"S_HITS",hits)

if pwd<>"" then
pwd="<b>解压密码:</b>[<font color=""#FF0000"">"&pwd&"</font>](红色部分)<br>"
else
pwd=""
end if
pencat=replace(pencat,"S_PWD",pwd)
pencat=replace(pencat,"T_TYPE",thistype)
pencat=replace(pencat,"T_NAME",ttype)
pencat=replace(pencat,"T_TITLE",thistitle)
pencat=replace(pencat,"TXtop",txtop)
pencat=replace(pencat,"DOWN_LIST",dlist)
pencat=replace(pencat,"XG_LIST",xlist)
pencat=replace(pencat,"XG_INFO",xinfo)
pencat=replace(pencat,"T_USER",user)

Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../soft/"&id&".htm"))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************
if request("type")="page" then%><font color="#FF0000">生成下载页完成</font><script LANGUAGE="JavaScript">
<!--
setTimeout('window.close();', 500);
// -->
</script>
<%end if%>
</body></html>
...全文
83 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
huhanshan013 2004-01-19
  • 打赏
  • 举报
回复
再顶,等帮助。。。。。
huhanshan013 2004-01-19
  • 打赏
  • 举报
回复
http://www.big666.com/soft/25315.htm
这是他生成的最后的效果

里面没有htm代码,怎么出来的?最明显表格怎么做在生成的页面里面??????
zhuomaocn 2004-01-19
  • 打赏
  • 举报
回复
pencat=rs("down_show")


response.write pencat
response.end

看一下.
模板报存在数据库里了啊。
huhanshan013 2004-01-19
  • 打赏
  • 举报
回复
zhuomaocn(烦啊) 你好,我想也是这样,我还想这个模板应该在什么地方的一个页面了
你看他的pencat 一直都是在替换东西,
所以应该是调出模板,pencat替换其参数,
可是,源程序都来了,还是没有发现这个晕死的模板啊?
挖地三尺,还是没有看出里面地破绽啊!
哥们,可能这里就是某个地方关键的转一句话,有哪位大哥知道
请指点迷津!神仙指路!!!
ctz 2004-01-19
  • 打赏
  • 举报
回复
研究中~
zhuomaocn 2004-01-19
  • 打赏
  • 举报
回复
没有仔细看,不过可能是这样。
有一个html的模板,并保存在数据库里。
读出这个html的模板,赋给某个变量,也就是这段代码里的pencat。
替换关键字。
输出。

dgseamaple 2004-01-19
  • 打赏
  • 举报
回复
不太清楚,顶一下!
后台管理,网址后加admin/Wrzcnet_login.asp帐户:admin密码:admin   仿京东商城网上购物系统正式版源码下载商城网站模板V2030强势推出!国内首个完全仿京东商城的购物系统,无论是程序的功能,还是网站系统的网站模板都是很京东商城风格的.中国最好的购物系统,本商城购物系统采用先进的AJAX技术与XML技术相融生成静态,速度更快!管理也更为轻松!仿京东商城源码,仿京东商城源码下载,仿京东商城系统源码,免费京东商城源代码,软件代码多重过滤结合强大的SEO优化可以快速被搜索引擎收录,独特的静态生成算法可以大大减轻服务器的负担,无论在生成速度还是安全方面都达到国内领先水平。   仿京东商城系统,京东商城程序, 仿京东商城模板V2030的部分特点与精华:在拥有HTM静态生成功能的基础上,系统在SEO优化方面更是表现得淋漓尽致,软件代码多重优化过滤,无论是整站还是商品、三级分类的各个设置等细节方面,均可独立设置搜索关键词及描述,让您的客户第一时间在搜索引擎中找到你!   由此可见,HTML静态版系统具有诸多优点:1、第一时间被搜索引擎收录,让客户第一时间找到您!2、大大减轻服务器负担,同等环境下,HTML静态版浏览速度要比ASP高出近10倍!即使在服务器负载较重的情况下,也不会让您漏失客户!3、更安全!HTML静态文件无任何漏洞,让您高枕无忧。4、更易维护和管理,后台只须轻轻一点,即可全部生成,方便快捷5、是电子商务时代所趋,目前较为流行的购物站均采用静态化的HTML,采用HTML静态版已是大势所趋。   免费的生成html静态文件的仿京东商城程序,多风格的网店系统,国内最强大的32套模板购物网站网软志成HTML静态版V2030,采用更为直观的静态生成模式!所有静态生成均在一个页面完成。购物网站模板下载,免费的购物程序商业版,同时采用极为先进的进度条调度模式!系统生成静态统一采用百分比及进度条直观显示,全站静态生成以进度条显示,以及生成的百度比!非常形象。生成过程随时掌控,使之更直观的呈现在人们面前!同时运用先进的技术手段,采用静态生成与动态跟踪技术,网店网站模板,网上商城网页模板下载,完全版的电子商务网站系统,静态生成页面实时显示未生成的数据,独创不重复生成技术!运用多种不同的生成规则使生成速度变的更为快速,仿京东商城网上购物系统正式版源码下载商城网站模板在生成HTM的基础上实现多种只有动态文件才有的功能,如用户状态、新闻的浏览率、相应的价格级别等信息!完美解决了HTM文件不能实时显示动态信息的瓶颈。   京东商城源程序免费下载,仿京东商城模板下载,京东商城购物网站程序,下载京东商城模板,以人性化管理为出发点,系统加入多种智能静态生成。生成HTML的购物网站网页模板,商城系统完全版,网上商店开店系统,管理商城也由此变得游刃有余!有仿京东商城购物系统access版,仿京东商城网站模板mssql版,仿京东商城网站管理系统access生成html版,京东商城风格网页模板网店系统mssql生成html版下载.   系统功能方面更是十分强大!静态版率先支持了商品三级分类,支持七种在线支付,京东商城网源代码,京东商城网站源程序,京东商城源码,仿京东商城免费模板,同时支持Excel批量导入商品、文字或图片水印设置功能、商品优惠券及免运费设置的高级功能于一体,同时支持邮件订单通知与群发、完美整合BBS程序以及图片自动清除功能等等。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧