zoukankan
html css js c++ java
ASP生成.shtml.html,多页
<
!
--
#include file
=
"
conn.asp
"
-->
<
html
><
head
><
TITLE
>
分页测试
</
TITLE
><
LINK href
=
"
inc/style.css
"
type
=
text
/
css rel
=
stylesheet
></
head
>
<
%
dim
strhead,sql,totalpage,j,whichpage,howmanyrecs,str0,ref,counter,yyyy
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>
"
%
>
<
%
yyyy
=
5
sql
=
"
select * from news order by atime desc
"
set
rs
=
server.createObject(
"
ADODB.Recordset
"
)
rs.open sql,conn,
1
,
1
%
><
%
rs.pagesize
=
yyyy
totalpage
=
rs.pagecount
rs.close
set
rs
=
nothing
for
j
=
1
to
totalpage
sql
=
"
select * from news order by atime desc
"
set
rs
=
server.createObject(
"
ADODB.Recordset
"
)
rs.open sql,conn,
1
,
1
whichpage
=
j
rs.pagesize
=
yyyy
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""><a href=
"
&
rs(
"
address
"
)
&
"
>
"
&
rs(
"
name
"
)
&
"
</a></td>
"
str0
=
str0
&
"
<td bgcolor=#f7f7f7 align=""center"">
"
&
rs(
"
atime
"
)
&
"
</td>
"
str0
=
str0
&
"
<td bgcolor=#f7f7f7 align=""center"">
"
&
rs(
"
text
"
)
&
"
</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
%
>
查看全文
相关阅读:
IPFS实践之初体验
自己写的屏幕录像及播放软件
绿色ip扫描工具
ASIHTTPRequest 编码问题
ios开发中,A valid provisioning profile for this executable was not found,的解决方法
毕业设计之蚁群算法的研究——起始篇
分享两个模拟get和post方法的工具类,让应用能够与服务器进行数据交互
安卓中生成二维码和扫描二维码
分享一个安卓中异步获取网络图片并自适应大小的第三方程序(来自github)
不只是个程序员
原文地址:https://www.cnblogs.com/zwl12549/p/863634.html
最新文章
关于ionic传值
关于ionic的一些坑(3)
关于ionic的一些坑(2)
关于ionic的一些坑(1)
C#与Java AES 加密解密
asp.net webapi 自定义身份验证
SQL Server @@ERROR的小误区大Bug
微信小程序-下拉事件(onPullDownRefresh)不触发
伪ajax上传文件
easyui tree 的数据格式转换
热门文章
解决jquery-easyui1.3.3 combobox 多选模式不兼容IE8问题
开博
AJax执行顺序
jquery展开收缩
spark 1.3 发布了
通知:spark meetup 第六次会议在北京举行
2015 Spark 将走向哪里?
scala 系列文章汇总
spark 系列文章汇总
IPFS实践之功能封装
Copyright © 2011-2022 走看看