以下几个过程是自己在工作中写出来的,虽然不好看,但满好用,在需要的地方调用,就可以产生不同样式的分页

'产生下拉列表式的页面导航栏
Sub BuildDropDownPageSelector(Total,TotalRecord)
    dim strUrl
    Dim Para
    dim CurrentPageId
    strUrl=Request.ServerVariables("URL")
    if Request.QueryString.Count>0 then
        strUrl=strUrl+"?"
        for each Para in Request.QueryString
            strUrl=strUrl+Para+"="+Request.QueryString(Para)+"&"
        next
        strUrl=Left(strUrl,Len(strUrl)-1)
    end if
    Set regEx = New RegExp 
       regEx.Pattern = "&PageId="+Request.QueryString("PageId") 
      regEx.IgnoreCase = True 
      regEx.Global = True 
    if regEx.Test(strUrl) then
        strUrl=regEx.Replace(strUrl,"")        
    else
        regEx.Pattern="\?PageId="+Request.QueryString("PageId")+"&"
        if regEx.Test(strUrl) then
            strUrl=regEx.Replace(strUrl,"?")            
        else
            regEx.Pattern="\?PageId="+Request.QueryString("PageId")
            if regEx.Test(strUrl) then
                strUrl=regEx.Replace(strUrl,"")                
            End if        
        end if    
    end if
    '仅在大于一页时显示导航栏
    if Total>1 then
    '产生一个合理的URL,有两种情况,一种是附有其他参数,一种是等于Request.SErverVariables("URL")的结果
    Response.write "<table width='100%'  border=0 cellpadding=2 cellspacing=0 id='Pager'><tr><td align=right>"
    Response.write "共<u><b>"&TotalRecord&"</b></u>条记录 "
    if strUrl=Request.ServerVariables("URL") then
    response.write "跳转到 <select OnChange=""window.location.href='"&strURL&"?PageId='+this.options[this.selectedIndex].value"">"        
    else
    response.write "跳转到 <select OnChange=""window.location.href='"&strURL&"&PageId='+this.options[this.selectedIndex].value"">"        
    end if
    CurrentPageId=cint(Request.querystring("PageId"))
    '处理PAGEID超过范围的情况
    if CurrentPageId<1 then CurrentPageId=1
    if CurrentPageId>Total then CurrentPageId=Total    
    for i=1 to Total
        if CurrentPageId=cint(i) then
        response.write "<option value='"&i&"' selected>第"&i&"页</option>"
        else
        response.write "<option value='"&i&"'>第"&i&"页</option>"
        end if
    next
    Response.write "</select>"
    response.write "</td></tr></table>"
    end if
End Sub
'产生前一页后一页式页面导航栏
Sub BuildFirstLastPageNavigate(Total,TotalRecord)
    dim strUrl
    Dim Para
    dim CurrentPageId
    strUrl=Request.ServerVariables("URL")
    if Request.QueryString.Count>0 then
        strUrl=strUrl+"?"
        for each Para in Request.QueryString
            strUrl=strUrl+Para+"="+Request.QueryString(Para)+"&"
        next
        strUrl=Left(strUrl,Len(strUrl)-1)
    end if
    Set regEx = New RegExp 
       regEx.Pattern = "&PageId="+Request.QueryString("PageId") 
      regEx.IgnoreCase = True 
      regEx.Global = True 
    if regEx.Test(strUrl) then
        strUrl=regEx.Replace(strUrl,"")        
    else
        regEx.Pattern="\?PageId="+Request.QueryString("PageId")+"&"
        if regEx.Test(strUrl) then
            strUrl=regEx.Replace(strUrl,"?")            
        else
            regEx.Pattern="\?PageId="+Request.QueryString("PageId")
            if regEx.Test(strUrl) then
                strUrl=regEx.Replace(strUrl,"")                
            End if        
        end if    
    end if
    '仅在大于一页时显示导航栏
    if Total>1 then
    '产生一个合理的URL,有两种情况,一种是附有其他参数,一种是等于Request.SErverVariables("URL")的结果
    Response.write "<table width='100%'  border=0 cellpadding=2 cellspacing=0 id='Pager'><tr><td align=right>"
    CurrentPageId=cint(Request.querystring("PageId"))
    '处理PAGEID超过范围的情况
    if CurrentPageId<1 then CurrentPageId=1     
    if CurrentPageId>Total then CurrentPageId=Total 
    Response.write "共<u><b>"&TotalRecord&"</b></u>条记录 当前是第 <u><b>"&CurrentPageId&"</b></u> 页&nbsp;&nbsp;"    
    if CurrentPageId>1 then
        if strUrl=Request.ServerVariables("URL") then
            response.write "<img src='/images/first.gif' border=0 align=absmiddl><a href='"+strUrl+"?PageId=1'>首页</a>&nbsp;&nbsp;<img src='/images/prev.gif' border=0 align=absmiddl>&nbsp;&nbsp;<a href='"+strUrl+"?PageId="&(CurrentPageId-1)&"'>上一页</a>&nbsp;&nbsp;"        
        else
            response.write "<img src='/images/first.gif' border=0 align=absmiddl><a href='"+strUrl+"&PageId=1'>首页</a>&nbsp;&nbsp;<img src='/images/prev.gif' border=0 align=absmiddl>&nbsp;&nbsp;<a href='"+strUrl+"&PageId="&(CurrentPageId-1)&"'>上一页</a>&nbsp;&nbsp;"        
        end if
    end if
    
    if CurrentPageId<Total then
        if strUrl=Request.ServerVariables("URL") then
            response.write "<img src='/images/next.gif' border=0 align=absmiddl><a href='"+strUrl+"?PageId="&(CurrentPageId+1)&"'>下一页</a>&nbsp;&nbsp;<img src='/images/Last.gif' border=0 align=absmiddl> <a href='"+strUrl+"?PageId="&Total&"'>尾页</a> "                    
        else
            response.write " <img src='/images/next.gif' border=0 align=absmiddl><a href='"+strUrl+"&PageId="&(CurrentPageId+1)&"'>下一页</a>&nbsp;&nbsp;<img src='/images/Last.gif' border=0 align=absmiddl> <a href='"+strUrl+"&PageId="&Total&"'>尾页</a>"                
        end if        
    end if    
    response.write "</td></tr></table>"
    end if
End Sub
'产生数字式翻页按钮
Sub BuildNumericalPageNavigate(Total,TotalRecord)
    dim strUrl
    Dim Para
    dim CurrentPageId
    strUrl=Request.ServerVariables("URL")
    if Request.QueryString.Count>0 then
        strUrl=strUrl+"?"
        for each Para in Request.QueryString
            strUrl=strUrl+Para+"="+Request.QueryString(Para)+"&"
        next
        strUrl=Left(strUrl,Len(strUrl)-1)
    end if
    Set regEx = New RegExp 
       regEx.Pattern = "&PageId="+Request.QueryString("PageId") 
      regEx.IgnoreCase = True 
      regEx.Global = True 
    if regEx.Test(strUrl) then
        strUrl=regEx.Replace(strUrl,"")        
    else
        regEx.Pattern="\?PageId="+Request.QueryString("PageId")+"&"
        if regEx.Test(strUrl) then
            strUrl=regEx.Replace(strUrl,"?")            
        else
            regEx.Pattern="\?PageId="+Request.QueryString("PageId")
            if regEx.Test(strUrl) then
                strUrl=regEx.Replace(strUrl,"")                
            End if        
        end if    
    end if
    
    '仅在大于一页时显示导航栏
    if Total>1 then
    '产生一个合理的URL,有两种情况,一种是附有其他参数,一种是等于Request.SErverVariables("URL")的结果
    Response.write "<table width='100%'  border=0 cellpadding=2 cellspacing=0 id='Pager'><tr><td align=right>"
    CurrentPageId=cint(Request.querystring("PageId"))
    '处理PAGEID超过范围的情况
    if CurrentPageId<1 then CurrentPageId=1     
    if CurrentPageId>Total then CurrentPageId=Total 
    
    if currentpageid mod 10=0 then
        nextpageid=fix(currentpageid/10)*10+1
        prevpageid=fix(currentpageid/10-1)*10
        minpageid=fix(currentpageid/10-1)*10+1
        maxpageid=fix(currentpageid/10)*10
        currentppid=fix(currentpageid/10)
    else
        nextpageid=(fix(currentpageid/10)+1)*10+1
        prevpageid=fix(currentpageid/10)*10
        minpageid=fix(currentpageid/10)*10+1
        maxpageid=(fix(currentpageid/10)+1)*10
        currentppid=fix(currentpageid/10)+1
    end if
    
    if total mod 10=0 then
        maxppid=fix(total/10)        
    else
        maxppid=fix(total/10)+1
    end if
    
    if nextpageid>=total  then
        nextpageid=total
    end if
    
    if prevpageid<=1 then
        prevpageid=1
    end if    
    
    if minpageid<=1 then
        minpageid=1
    end if    
    
    if maxpageid>=total  then
        maxpageid=total
    end if    
    
    if currentppid>1 then
        response.write "<a href='"&strUrl&"?pageid="&prevpageid&"'></a>&nbsp;&nbsp;"
    end if
    
    
    for countery=minpageid to maxpageid
        if countery=CurrentPageId then
        response.write "<a href='"+strUrl+"?PageId="&countery&"' style='background-color:#666666;color:#ffffff'>"&countery&"</a>"
        else
        response.write "<a href='"+strUrl+"?PageId="&countery&"'>"&countery&"</a>"
        end if
    next
    
    
    if currentppid<maxppid then
        response.write "&nbsp;&nbsp;<a href='"&strUrl&"?pageid="&nextpageid&"'></a>"
    end if
    
    response.write "</td></tr></table>"
    end if
End Sub

调用方法:

sub BuildProductList(StyleMode,ProductPerPage,ProductPerRow)
i=1
response.write "<table   align='center'  cellpadding='0' cellspacing='0' width='100%' height='100%'>"
if totalrecord>productperpage then
response.write "<tr height=25><td colspan='"&(ProductPerRow*2)&"'>"
BuildNumericalPageNavigate totalpage,totalrecord
response.write "</td></tr>"
end if
response.write "<tr><td colspan='"&(ProductPerRow*2)&"' height=10></td></tr>"

产生效果:

转载于:https://www.cnblogs.com/Heroman/archive/2006/08/31/491628.html

心情好,贴一小段自己写的VBS服务器端过程,做了适度封装相关推荐

  1. Java中有关日期的操作,昨天晚上赴约,搞到12点多才回来,今天写这一小段代码都花了一段漫长的时间,哎。。...

    Java中有关日期的操作,昨天晚上赴约,搞到12点多才回来,今天写这一小段代码都花了一段漫长的时间,哎.. 代码奉上: /** * * @param date * @return which mont ...

  2. Android之使用SoundPool播放一小段音频,实现猜歌的功能

    这里,首先附上软件运行后的界面: 1.在播放音乐中,我介绍过利用MediaPlayer来播放音乐,这个类占用资源多,并且不支持播放多个音频,在Android中还提供了一个播放音频的类,即SoundPo ...

  3. 计算机写给未来自己的一段话,写给以后的自己一段话 致未来自己的唯美句子...

    每个人对未来的自己都会有期待,既然有期待,不妨呈现在记录下对未来的信念与憧憬.以下是小编给大家整理的写给以后的自己一段话,致未来自己的唯美句子,欢迎参阅. 写给以后的自己一段话 1.时间能给出一切答案 ...

  4. mysql 空闲几分钟速度变慢,MYSQL 运作一小段时间后,速度变得奇慢。而CPU基本空闲状态...

    当前位置:我的异常网» MySQL » MYSQL 运作一小段时间后,速度变得奇慢.而CPU基本 MYSQL 运作一小段时间后,速度变得奇慢.而CPU基本空闲状态 www.myexceptions.n ...

  5. 怎样把视频中的一小段制作成 GIF动图

    平常生活中大家聊天肯定会发现有很多斗图高手,不管是家人群.同学群还是好友群,从不缺乏这样的人,大多数用来斗图的图片都是GIF动图,GIF动图即有趣又形象,像小视频一样,只不过它是图片格式.大家对GIF ...

  6. 如何给一小段视频添加音乐

    最近很多人应该都在追知否知否,小编作为一个只爱看偶像剧和宫廷剧的代表,最后也被这剧吸引了,相较很多电视剧,它的时代背景有些不同,里面的大娘子可谓是整部剧的笑点,当我们看到搞笑的片段是不是都有想录制截取 ...

  7. matlab如何找到音乐节拍,beatTrackMaster matlab实现的节拍感知音乐工具。可以 较有 规律的一小段 当做ma 238万源代码下载- www.pudn.com...

    文件名称: beatTrackMaster下载 收藏√  [ 5  4  3  2  1 ] 开发工具: matlab 文件大小: 4455 KB 上传时间: 2013-04-30 下载次数: 11 ...

  8. 从键盘输入一小段英文(其中可以包含空格,但在同一行),利用函数统计该段英文中包含几个单词,输出统计出的单词数量、最长单词的长度以及长度最长的单词,空格隔开。

    题目描述: 在进行文章重复度检查时,经常需要统计一段英文中的单词数量,并找出长度最长的单词. 设有如下定义:char str[500]; 编写程序,通过利用cin.getline(str,500);实 ...

  9. Arduino蜂鸣器《Viva La Vida》一小段旋律

    在课上练习的时间里扒了一小段旋律,如果有人用得上请自取~ 代码是从整个作业完整版中改过来的,删成这样不知道能不能正常运行,不过重点是谱面嘛-- #define F4 349 #define G4 39 ...

  10. 如何给一小段视频添加音乐 1

    最近很多人应该都在追知否知否,小编作为一个只爱看偶像剧和宫廷剧的代表,最后也被这剧吸引了,相较很多电视剧,它的时代背景有些不同,里面的大娘子可谓是整部剧的笑点,当我们看到搞笑的片段是不是都有想录制截取 ...

最新文章

  1. 指定服务器无效,安装sqlserver2008r2 服务器配置,服务帐户配置出错,提示Sql server服务指定的凭据无效...
  2. POJ2352:Stars——题解
  3. SSO单点登录系列2:cas客户端和cas服务端交互原理动画图解,cas协议终极分析
  4. openoffice linux 目录,Linux之安装OpenOffice
  5. tar打包和解压命令
  6. c语言xml字符串,C语言的XML解析器
  7. 斐波那契实现阶乘js_功能与命令式编程。 Java 8中的斐波那契,素数和阶乘
  8. ssm上传文件获取路径_SSM实现图片上传下载功能
  9. C#.NET中的事件2
  10. python对文件的处理_python文件处理fileinput使用方法详解
  11. QT每日一练day11:QMainWindow
  12. Mac怎么终端配置mysql_mysql mac怎么在终端安装
  13. word模板文档替换,解决并发导致替换失败
  14. 吴昊品工程级别软件项目 Round 1 —— 吴昊教你玩字幕
  15. 谷歌浏览器配置微信浏览器_微信网页版 - Chrome社交与通讯插件 - 画夹插件网
  16. 虚拟机安装win7出现错误
  17. Excel批量根据银行卡号查询银行卡的详细信息
  18. 与小卡特一起学python 豆瓣_《父与子的编程之旅:与小卡特一起学Python》
  19. mysql启动跳过错误_mysql启动错误
  20. 使用pandas批量重命名(指定Excel中的对应列)

热门文章

  1. Linux之用户和组账户管理命令
  2. vc 热键、组合键的用法 MFC c++ hotkey WM_HOTKEY
  3. 基于SPSS的医疗医保费用数据分析预测(C#)
  4. masm汇编器以及汇编流程
  5. kirin710f是什么处理器_hisiliconkirin710是什么处理器
  6. 量化指标公式源码_五行量化副图指标 源码 通达信
  7. Doom3 couldn't load default.cfg
  8. 小微企业如何通过地推实现精准获客?
  9. 树莓派Ubuntu21.04,树莓派4b/4g,Python3.9.5搭建PyTorch
  10. Elasticsearch实战(十四)---聚合搜索Aggs多层嵌套聚合处理