惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
C
CERT Recently Published Vulnerability Notes
Know Your Adversary
Know Your Adversary
Security Archives - TechRepublic
Security Archives - TechRepublic
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
AI
AI
O
OpenAI News
M
MIT News - Artificial intelligence
Scott Helme
Scott Helme
U
Unit 42
P
Proofpoint News Feed
罗磊的独立博客
C
Check Point Blog
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
Apple Machine Learning Research
Apple Machine Learning Research
T
The Exploit Database - CXSecurity.com
I
InfoQ
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
Webroot Blog
Webroot Blog
P
Palo Alto Networks Blog
C
Cybersecurity and Infrastructure Security Agency CISA
N
News and Events Feed by Topic
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
A
About on SuperTechFans
美团技术团队
J
Java Code Geeks
T
Tenable Blog
L
LINUX DO - 最新话题
NISL@THU
NISL@THU
G
Google Developers Blog
Forbes - Security
Forbes - Security
爱范儿
爱范儿
S
Security @ Cisco Blogs
Project Zero
Project Zero
有赞技术团队
有赞技术团队

博客园 - 过客匆匆

几个Javascript函数 - 过客匆匆 - 博客园 一个在vbscript中读取cookie的程序函数 ASP2HTML WITH TEMPLET [转载] [转载]网站生成静态页面攻略 用Visual C#打造多页面网页浏览器 嵌套使用DATAList 漫谈ASP.NET设计中的性能优化问题 ASP生成静态网页的方法 令网站打开提高速度的7大秘方 ASP.NET 格式化字符串(转) 选项卡 注册时倒计时的东西 天气预报代码 asp.net中让服务器端控件获得焦点 ACCESS数据库的压缩,备份,还原,下载,删除的实现 数据库存储过程分页显示 无效的 CurrentPageIndex 值 一个比较实用的大数据量分页存储过程 动态ASP网站生成HTM、HTML静态网站方法 模板生成静态页面
惊云下载系统里的html文件生成方法 - 过客匆匆 - 博客园
过客匆匆 · 2006-06-04 · via 博客园 - 过客匆匆

这里惊云下载系统里的html文件生成方法,看了一下满有用的,所以发上来
<%
set rs=server.createobject("adodb.recordset")
rs.open ("select info_list from mb"),conn,1,1
pencat=rs("info_list")
rs.close

tid=request("tid")
currentPage=cint(request("page"))
MaxPerPage=cint(request("MaxPerPage"))
    
'################ 读取标题 等.. 开始 ################
  rs.open "select * from infotype where id="&tid,conn,1,1
  if not rs.eof then
    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=""../info/"&TI(i)&"_1.htm"">"&TN(i)&"</a>"
             thistitle=thistitle & " - "&TN(i)&""
          next
  end if
  rs.close

sql="select * from infotype where ts like '"&ts&"%'"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
   sqqq=sqqq& ""&rs("id")&", "
rs.MoveNext
loop
end if
rs.close

''########读取下级分类
rs.open "select * from infotype where tn="&tid&" order by id",conn,1,1
if NOT rs.EOF then
TTY="NO"
Tname=all_type_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<a href=""../info/"&rs("id")&"_1.htm""><font color=""#000000"">"&TTNN&"</font></a>chr(13)&Chr(10)"
rs.MoveNext
loop
end if
rs.close
if TTY_id<>"" and TTY<>"NO" then
rs.open "select * from infotype where tn="&TTY_id&" order by id",conn,1,1
if NOT rs.EOF then
Tname=TTY_name
do while NOT rs.EOF
TTNN=split(rs("tname"),"|")(rs("tj")-1)
  TXlist=TXlist&"<a href=""../info/"&rs("id")&"_1.htm""><font color=""#000000"">"&TTNN&"</font></a>chr(13)&Chr(10)"
rs.MoveNext
loop
end if
rs.close
end if
''########读取本类top10
sql="select * from info where tid in("&sqqq&") 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=""../info/"&rs("id")&".htm"">"&rs("title")&"</a>chr(13)&Chr(10)"
if h>=10 then exit do
rs.movenext
loop
h=0
end if
rs.close
'读取文章列表
              
sql="select * from info where tid in("&sqqq&") order by date desc"
rs.open sql,conn,1,1
if rs.eof then
 lb=lb&"<tr><td width=""100%"" colspan=""3"">对不起! 暂时没有相关文章 @_@</td></tr>"
mpage=1
allshu=0
else
rs.pagesize=MaxPerPage '得到每页数
mpage=rs.pagecount     '得到总页数
rs.move  (currentPage-1)*MaxPerPage
allshu=rs.recordcount
h=0
do while not rs.eof
h=h+1
  lb=lb&"<tr height=""22""><td width=""77%""><img border=""0"" src=""../images/d_2.gif"" width=""11"" height=""11"">["
    set rs_type=server.CreateObject("ADODB.RecordSet")
    rs_type.open "select * from infotype where id="&rs("tid"),conn,1,1
    if not rs_type.EOF then
       TN=split(rs_type("tname"),"|")
  lb=lb&"<a href="""&rs("tid")&"_1.htm""><font color=""#000000"">"&TN(ubound(TN)-1)&"</font></a></FONT>"
    end if
    rs_type.close
  lb=lb&"] <a href=""../info/"&rs("id")&".htm"">"&rs("title")&"</a></td>"
  lb=lb&"<td width=""13%"" align=""center"">"&year(rs("date"))&"-"&month(rs("date"))&"-"&day(rs("date"))&"</td>"
  lb=lb&"<td width=""10%"" align=""center"">"&rs("hits")&"</td></tr>"
  lb=lb&"<tr><td width=""100%"" height=""1"" bgcolor=""#CCCCCC"" colspan=""3""></td></tr>"
if h>=MaxPerPage then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
'#########读取页次
lb=lb&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""15%"" nowrap>页次:<b>"¤tPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 文章数<b>"&allshu&"</b></td><td width=""65%"" nowrap><p align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
lb=lb&"<a href=../info/"&tid&"_1.htm title=""最前页"">"
end if
lb=lb&"<font face=""Webdings"">9</font></a> "
if cint(pageno)>1 then
lb=lb&"<a href=../info/"&tid&"_"&pageno-1&".htm title=""上一页"">"
end if
lb=lb&"<font face=""Webdings"">7</font></a>"
pp=cint(pageno)-2           
  if pp<1 then           
  pp=1           
  end if           
for pno=pp to mpage
p=p+1
if pno*1=cint(pageno)*1 then
lb=lb&" <font color=""#FF0000"">["&pno&"]</font>"
else
lb=lb&" <a href=../info/"&tid&"_"&pno&".htm>["&pno&"]</a>"
end if                                                                       
if p>=5 then exit for           
next
lb=lb&" "
if cint(pageno)< mpage then
lb=lb&"<a href=../info/"&tid&"_"&pageno+1&".htm title=""下一页"">"
end if
lb=lb&"<font face=""Webdings"">8</font></a> "
if cint(pageno)< mpage then
lb=lb&"<a href=../info/"&tid&"_"&mpage&".htm title=""最后页"">"
end if
lb=lb&"<font face=""Webdings"">:</font></a></p></td><td width=""18%"" nowrap><table cellpadding=""0"" cellspacing=""0"">"
lb=lb&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">"
lb=lb&"<tr><td nowrap>到<select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
   for i=1 to mpage
      selected=""
      if currentpage=i then
          selected=" selected"
      end if
    lb=lb&"<option value=../info/"&tid&"_"&i&".htm"&selected&">"&i&"</option>"
   next
lb=lb&"</select>页</td></td></tr></form></table></td></tr></table>"
 '################ 读取完成 ################
 
pencat=replace(pencat,"T_TITLE",thistitle)
pencat=replace(pencat,"T_NAME",tname)
pencat=replace(pencat,"TXlist",txlist)
pencat=replace(pencat,"TXtop",Txtop)

pencat=replace(pencat,"T_LB",lb)
pencat=replace(pencat,"T_TXT",typetxt)
pencat=replace(pencat,"T_TYPE",thistype)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(server.mappath("../info/"&tid&"_"¤tPage&".htm"))
fout.Write pencat
fout.close
'************** 生成HTML页 结束 ***************