asp 文章自动分页代码

来源:百度知道 编辑:UC知道 时间:2024/05/20 10:33:47
我需要的是实际项目中的源代码,不是在网上随便找的来应付的,最好是按行数来分页

dim page,pagecount,thispage,linenum,allline

const pageline=10 '每页显示10行
linenum=split(content,"<br>") '本例为计算字符串<br>标记的个数
allline=ubound(linenum)+1 '全文<br>(换行标记)总数
pagecount=int(allline\pageline)+1 '计算总页数
page=request("page")
if isempty(page) then
thispage=1
else
thispage=cint(page)
end if
response.write "<title>"&title&"</title><b>"&title&"</b><hr>"
for i=0 to allline
if i+1>thispage*pageline-pageline and i<thispage*pageline then
response.write linenum(i) &"<br>" '输出分页后的内容
end if
next
response.write chr(13)&"<hr>"
response.write "<p align='center'>总共"&allline&"行 "&pagecount&"页 每页"&pageline&"行 "
for i=1 to pagecount
if thispage=i then
response.w