这是asp分页列表生成静态页面得asp小程序脚本
复制代码 代码如下:
<!--#include file="conn.asp"-->
<html><head><TITLE>分页测试</TITLE><LINK href="inc/style.css" type=text/css rel=stylesheet></head>
<%strHead=strHead&"<html>"
strHead=strHead&"<head>"
strHead=strHead&"<TITLE>分页测试</TITLE>"
strHead=strHead&"<LINK href=""inc/style.css"" type=text/css rel=stylesheet>"
strHead=strHead&"</head>"
%>
<%
sql="select * from news"
set rs=server.createObject("ADODB.Recordset")
rs.open sql,conn,1,1
%><%
rs.pagesize=2
totalpage=rs.pagecount
rs.close
set rs=nothing
for j=1 to totalpage
sql="select * from news"
set rs=server.createObject("ADODB.Recordset")
rs.open sql,conn,1,1
whichpage=j
rs.pagesize=2
totalpage=rs.pagecount
rs.absolutepage=whichpage
howmanyrecs=0
%><%
str0=""
str0=str0&"</p>"
str0=str0&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=2 cellspacing=1>"
%><%
do while not rs.eof and howmanyrecs<rs.pagesize
%><%
str0=str0&"<tr bgcolor=#f7f7f7>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(0)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(1)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(2)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(3)&"</td>"
str0=str0&"</tr>"
%><%
rs.movenext
howmanyrecs=howmanyrecs+1
loop
rs.close
set rs=nothing
%><%str0=str0&"</table>"
%><%
'分页部分
ref=""
ref=ref&"<br>"
ref=ref&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=0 cellspacing=1> "
ref=ref&"<tr bgcolor=#f7f7f7>"
ref=ref&"<td> "
ref=ref&"<b>Pages: " & j & " / " & totalpage &"</b>"
ref=ref&"</td>"
ref=ref&"<td> "
ref=ref&"<a href=list_1.html"&">" & "<FONT face=Webdings>9</FONT>" & "</a> "
if whichpage=1 then
ref=ref&"<FONT face=Webdings>7</FONT>"
else
ref=ref&"<a href=list_"&j-1&".html"&">" & "<FONT face=Webdings>7</FONT>" & "</a> "
end if
for counter=1 to totalpage
ref=ref&"<a href=list_"&counter&".html"&">[" & counter & "]</a>"
ref=ref& " "
if counter mod 10 = 0 then
ref=ref& "<br>"
end if
next
if (whichpage>totalpage or whichpage=totalpage) then
ref=ref&"<FONT face=Webdings>8</FONT>"
else
ref=ref&"<a href=list_"&j+1&".html"&">" & "<FONT face=Webdings>8</FONT>" & "</a> "
end if
ref=ref&"<a href=list_"&totalpage&".html"&">" & "<FONT face=Webdings>:</FONT>" & "</a> "
Dim fso,f
Dim strTitle,strContent,strOut
'创建文件系统对象
Set fso=Server.createObject("Scripting.FileSystemObject")
Set f=fso.createTextFile(Server.MapPath("list_"&j&".html"),true)
'写入网页内容
f.WriteLine strHead&str0&ref
f.close
response.write "正在生成第"&j&"个页面!<br>"
%><%
next%>
复制代码 代码如下:
<!--#include file="conn.asp"-->
<html><head><TITLE>分页测试</TITLE><LINK href="inc/style.css" type=text/css rel=stylesheet></head>
<%strHead=strHead&"<html>"
strHead=strHead&"<head>"
strHead=strHead&"<TITLE>分页测试</TITLE>"
strHead=strHead&"<LINK href=""inc/style.css"" type=text/css rel=stylesheet>"
strHead=strHead&"</head>"
%>
<%
sql="select * from news"
set rs=server.createObject("ADODB.Recordset")
rs.open sql,conn,1,1
%><%
rs.pagesize=2
totalpage=rs.pagecount
rs.close
set rs=nothing
for j=1 to totalpage
sql="select * from news"
set rs=server.createObject("ADODB.Recordset")
rs.open sql,conn,1,1
whichpage=j
rs.pagesize=2
totalpage=rs.pagecount
rs.absolutepage=whichpage
howmanyrecs=0
%><%
str0=""
str0=str0&"</p>"
str0=str0&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=2 cellspacing=1>"
%><%
do while not rs.eof and howmanyrecs<rs.pagesize
%><%
str0=str0&"<tr bgcolor=#f7f7f7>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(0)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(1)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(2)&"</td>"
str0=str0&"<td bgcolor=#f7f7f7 align=""center"">"&rs(3)&"</td>"
str0=str0&"</tr>"
%><%
rs.movenext
howmanyrecs=howmanyrecs+1
loop
rs.close
set rs=nothing
%><%str0=str0&"</table>"
%><%
'分页部分
ref=""
ref=ref&"<br>"
ref=ref&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=0 cellspacing=1> "
ref=ref&"<tr bgcolor=#f7f7f7>"
ref=ref&"<td> "
ref=ref&"<b>Pages: " & j & " / " & totalpage &"</b>"
ref=ref&"</td>"
ref=ref&"<td> "
ref=ref&"<a href=list_1.html"&">" & "<FONT face=Webdings>9</FONT>" & "</a> "
if whichpage=1 then
ref=ref&"<FONT face=Webdings>7</FONT>"
else
ref=ref&"<a href=list_"&j-1&".html"&">" & "<FONT face=Webdings>7</FONT>" & "</a> "
end if
for counter=1 to totalpage
ref=ref&"<a href=list_"&counter&".html"&">[" & counter & "]</a>"
ref=ref& " "
if counter mod 10 = 0 then
ref=ref& "<br>"
end if
next
if (whichpage>totalpage or whichpage=totalpage) then
ref=ref&"<FONT face=Webdings>8</FONT>"
else
ref=ref&"<a href=list_"&j+1&".html"&">" & "<FONT face=Webdings>8</FONT>" & "</a> "
end if
ref=ref&"<a href=list_"&totalpage&".html"&">" & "<FONT face=Webdings>:</FONT>" & "</a> "
Dim fso,f
Dim strTitle,strContent,strOut
'创建文件系统对象
Set fso=Server.createObject("Scripting.FileSystemObject")
Set f=fso.createTextFile(Server.MapPath("list_"&j&".html"),true)
'写入网页内容
f.WriteLine strHead&str0&ref
f.close
response.write "正在生成第"&j&"个页面!<br>"
%><%
next%>
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“asp分页生成html的程序脚本代码”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。