<% dim rsArticleList FileName="news.asp" '需要分的页面 if request("page")<>"" then currentPage=cint(request("page"))'currentPage是Request.QueryString得到page的值,既为页数 else currentPage=1 '如果不够15条就为1页 end if const MaxPerPage=20 '每页的记录数 set rsArticleList=server.CreateObject("adodb.recordset") strSQL = "SELECT * FROM Article where ClassID=3 order by ontop,UpdateTime Desc" rsArticleList.open strSQL,conn,1,1 %> <% if rsArticleList.eof and rsArticleList.bof then totalPut=0 '记录数为零 response.write "" response.write "

对不起!没有查询到您要找的信息!
" else totalPut=rsArticleList.recordcount 'totalput代表的返回记录的数量 if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent else if (currentPage-1)*MaxPerPage
·
<% if rsArticleList("isOuturl")=true then %> " target="_blank"> <%=rsArticleList("Title")%> <% else %> " target="_blank"> <%=rsArticleList("Title")%> <% end if %> <% if (now()-cdate(rsArticleList("UpdateTime")))<3 then %> <% end if %>  [<%=formatdatetime(rsArticleList("UpdateTime"),2)%>]
<% ArticleNum=ArticleNum+1 if ArticleNum>=MaxPerPage then exit do rsArticleList.movenext loop end sub %>
<%if totalPut>MaxPerPage then showpage FileName,totalput,MaxPerPage,true,true,"篇文章"%>
<% function JoinChar(strUrl) if strUrl="" then JoinChar="" exit function end if if InStr(strUrl,"?")1 then if InStr(strUrl,"&")" & totalnumber & " " & strUnit & "  " end if strUrl=JoinChar(sfilename) if CurrentPage<2 then strTemp=strTemp & "  首页 上一页 " else strTemp=strTemp & "  首页 " strTemp=strTemp & "上一页 " end if if n-currentpage<1 then strTemp=strTemp & "下一页 尾页  " else strTemp=strTemp & "下一页 " strTemp=strTemp & "尾页  " end if strTemp=strTemp & "  页次:" & CurrentPage & "/" & n & "页 " 'strTemp=strTemp & " " & maxperpage & "" & strUnit & "/页" if ShowAllPages=True then strTemp=strTemp & " 转到:" end if strTemp=strTemp & "" response.write strTemp end sub %>