Chinaunix首页 | 论坛 | 博客
  • 博客访问: 442455
  • 博文数量: 1496
  • 博客积分: 79800
  • 博客等级: 大将
  • 技术积分: 9940
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-09 13:22
文章分类

全部博文(1496)

文章存档

2011年(1)

2008年(1495)

我的朋友

分类:

2008-09-09 17:22:59

          public static final String splitPages2(int thePage, String queryString, int count,

                int pageLength)

        {

            int maxPage = count / pageLength + 1;

            int prevPage = thePage - 1;

            if (prevPage < 1)

            {

                prevPage = 1;

            }

            int nextPage = thePage + 1;

 

            int showMaxPage = thePage + 6;

            int spacePage = 1;

 

            if (thePage > 6)

            {

                spacePage = thePage - 5;

            }

            if (showMaxPage < 10)

            {

                showMaxPage = 10;

            }

    //

上一页010203

            StringBuffer sb = new StringBuffer();

            sb.append("

第一页");

            sb.append("上一页");

            for (int i = spacePage; i < showMaxPage && i <= maxPage; i++)

            {

                String fontColor = "black";

                if (i == thePage)

                {

                    fontColor = "red";

                }

                sb.append("" + addzero(i, 2)

                        + "");

            }

 

[1]  

【责编:landy】

--------------------next---------------------

阅读(110) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~