星☆空 | 对生活要知足,学习要不知足,为人处事要知不足. 卍 ♂ | ♀ 卐 - 科技以人为本.

QQ:908202921, Msn:btbtd@live.com gI.2288.oRg:88 绿色学院 - GrEeN InsTiTutE, www.btbtd.org

用户操作
[即时聊天] [发私信] [加为好友]
邱少伟ID:btbtd
413975次访问,排名128,好友265人,关注者252人。
韬光养晦
http://www.btbtd.org/
http://gi.2288.org/
btbtd的文章
原创 429 篇
翻译 3 篇
转载 16 篇
评论 362 篇
shawl.qiu的公告
www.btbtd.org
gi.2288.org
最近评论
半瓶墨水:其实可以考虑到代码发芽网贴一下然后复制粘贴高亮代码到blog,等于是在线的代码语法高亮软件

支持近百种语言代码语法高亮,有多种配色主题可供选择:

fayaa.com/code
FAFAFA:这种方法可行吗???如果其他人在同时也插入了新数据,取到的到底是谁的啊?
大名:dfgdf
大名:sadasdasdasdasdsad
大名:dsdfsd
文章分类
收藏
相册
#蔡淳佳
#实用素材图片 1
#实用素材图片 2
#喜欢的作品
#资料截图
Aselin Debison
Avatar
Background
Blog
Concept
Diary
Doodle
Doodle 2005
Enigma
excite jp
fresh flowers
Google
Guestbook
Logo
Matter
Me
MSN
Music Cover
My Album
My Desktop
Opera
Oracle
OragTiger
PP Photo
Search
Signature
Sophie Zelmani
VMWARE
Wallpaper
wwy
wwy_baby_blue
wwy_my_room
wwy_stone_beige
Xoops
Xoops Newbb
Xoops Themes
Xoops Xphpbbi
YiMengCz I
#1. Algorithm
Bit Twiddling Hacks - By Sean Eron Anderson
Paj's Home
XySSL
高度な JavaScript 技集
0. ASP
aspfaq.com
codeproject.com
motobit.com
0. ASP.NET(C#)
ASP .NET FAQ
C# Frequently Asked Questions
C# General FAQ
C# MVP Bloggers
0. CSS
Comparison of layout engines (CSS)
0. Javascript
Comparison of layout engines (DOM)
Comparison of layout engines (ECMAScript)
crockford.com
faqts.com/javascript
Pat's Place: A technology demonstrator project.
0. SQL
Comparison of different SQL implementations
Comparison of SQL syntax
What are reserved Access, ODBC and SQL Server keywords?
What are the main differences between Access and SQL Server?
0. Tool Kits
ECMA Standards
faqts.com
Mozilla docs
RFC's
W3C TR
1. Search Engines
Alexa Web Search
All the web
AltaVista Search
AOL Web Search
Baidu
CrazySearch!
CSDN Blog Search
Excite
FeedsS's Blog
Google
Kingsoft
Lycos Search
Lyric Search
Mpeg Search
MSN Search
Search.com
SoGua
Soudu
xx-hacker
Yahoo [cn]
Yahoo [en]
Yisou
2. English Forum
#旺旺英语论坛
#英语写作论坛
Learners english club
3. Linux Forum
#三峡大学 LINUX联盟(RSS)
#中国 Linux 公社(RSS)
#黄嘴企鹅论坛(RSS)
Fedora 1.0 问题(RSS)
LINUX 1000 Q(RSS)
Linux 伊甸园(RSS)
4. PHP Forum
#中文PHP俱乐部(RSS)
#超越 PHP(RSS)
5. Other Site
#中国网络研究与搜索论坛
#在线翻译(RSS)
#常用书籍打包
#电子图书下载(RSS)
#科迈网(RSS)
#蓝色理想(RSS)
#西安信息资源网
CSDN.NET(RSS)
Google Hacker Database
Web Design Group
Webmaster world
6. Enjoy Site
#新华网论坛(RSS)
#极点视觉绘画站(RSS)
#涂鸦王国(RSS)
#牧文财经(RSS)
#猫扑大杂烩(RSS)
7. Resource
Active Perl
Apache
j2sdk-1_4_2-windows-i586
mm.mysql-2.0.4-bin.jar
mod_jk_1.2.5_2.0.47.dll
mod_rewrite
MySql
PHP
phpMailer
Source Forge Xoops
Tomcat
Web Server Resource
Win2k3
Zend
8. My Blog
#搜索引擎优化 Seo-GI
#绿色学院 - Green Institute
Blogcn(RSS)
GI Technology
GI-BB Developer Team
Green Institute
MSN Blog
Wallop Flash
Wallop HTML (RSS)
卐-_卍 信仰,理想,追求,博爱,自强,厚德.(RSS)
9. Music & Album
GaeAhit
USTC
VeryCD-MTV
A. Manual
Apache Manual
CSS Level 2 Manual
HTML 4.01 Manual
Javascript Manual
MySql Manual (cn) 2
MySql Manual (en) 1
PEAR Manual
PHP Manual
PHP-GTK Manual
Regular Expression Library
Smarty Manual
W3C Technical Reports and Publications
XHTML 1.0 Manual
XML 1.0 Manual
B. Google Cheat
Blog.com
ChinaUnix
cnblogs
donews
Google Groups
Teeta
Tom blog
Yahoo Groups
Yculblog
C. Friend's Blog
#我爱生命中存在的那一切(RSS)
#老贼在干嘛?(RSS)
#鸣乐谷
Color_Se SeSe 颜色(RSS)
Drink Drank Drunk
PLANTUNT的珍贵资源
D. SEO
Keywords 1 (Google)
Keywords 2 (Baidu)
Keywords 3 (Yisou)
Marketleap.com
Pagerank 1
Pagerank 2
Pagerank 3
Trafficzap.com
Uptimebot.com
Webconfs
E. Technology
http://bt.it.to/
http://bt.qq.to/
http://bt.zz.to/
http://du.u.to/
http://gi.dd.to/
http://gi.if.to/
http://gi.kk.to/
http://gi.pc.to
http://gi.xx.to/
http://mail.it.to/
http://nba.it.to
http://se.u.to/
F. Literature
#逐浪文学
KK 书库
G. Math/Geometry
台湾一个不错的数学站
H. Works
宝莱迪
I. SEO Link
paolid
shawl.qiu CSharp DotNet 个人资料管理系统
shawl.qiu CSharp DotNet 个人资料管理系统
shawl.qiu CSharp DotNet 个人资料管理系统
依梦卫浴-依梦洁具(北京)厂家直销店
卫浴生活坊
满意洁具馆
热弯玻璃
热熔玻璃
热熔玻璃
玻璃
玻璃制品
艺术玻璃
存档
软件项目交易
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
订阅到BlogLines
订阅到Yahoo
订阅到GouGou
订阅到飞鸽
订阅到Rojo
订阅到newsgator
订阅到netvibes

原创 ASP 通用文章分页函数(非记录集分页), 返回多个结果, 字典实现 By shawl.qiu收藏

新一篇: ASP 无重复数字随机函数, 数组实现, 并应用于随机显示记录集 By shawl.qiu | 旧一篇: 在 Access 里使用查询建立 存储过程/视图, 并使用 ASP 执行 By shawl.qiu

ASP 通用文章分页函数(非记录集分页), 返回多个结果, 字典实现 By shawl.qiu


说明: 
本函数为文章分页, 非记录集分页
本函数实现将文章分页显示, 并以指定长度显示每一分页
本函数实现不需指定 URL, 自动更替 URL
本函数实现返回多个结果, 为: 分页链接-文章统计信息-文章内容, 由字典实现
如果分页大小大于文章总大小, 分页链接将为空.

显示如:
第1页 第2页 第3页 第4页 第5页 
50,000字/页 1/5页 共235,289字
正文...

注: 显示内容的三个元素可自由变更位置.

附注: 
如果您是在查找 记录集分页函数, 鄙人以前也写过一个, 名为 "ASP VBScript 分页函数 by Stabx, 第三版".
链接:   http://blog.csdn.net/btbtd/archive/2006/05/31/765595.aspx

shawl.qiu
2006-09-04
 http://blog.csdn.net/btbtd

主内容: 分页函数及调用代码
    linenum
  1. <% 
  2.     dim rs, dic
  3.     set rs=createObject("adodb.recordset")
  4.         rs.open "select * from ctat where aid=15783",conn
  5.         'rs.open "select * from ctat where aid=12850",conn
  6.  
  7.         set dic=fAtPgnt(rs("content"),50000,request.queryString("apid"))
  8.             response.write dic("pgnt")&"<br/>"
  9.             response.write dic("info")&"<br/>"
  10.             response.write dic("cnt")&"<br/>"
  11.         set dic=nothing
  12.         rs.close
  13.     set rs=nothing
  14.  
  15.     function fAtPgnt(aStr,pSize,rId)
  16.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  17.     'ASP 通用文章分页函数(非记录集分页), 返回多个结果, 字典实现 By shawl.qiu
  18.     ' http://blog.csdn.net/btbtd
  19.     '2006-09-04
  20.     '''''''''''''''''''''''''''
  21.     '输入参数说明:
  22.     'aStr 为要分页的字符串
  23.     'pSize 为每页大小数字
  24.     'rId 为 URL 参数 ID, 默认为 apid, 由函数里的 rName 变量定义
  25.     '''''''''''''''''''''''''''
  26.     '输出参数说明:
  27.     'obj("pgnt") 为文章翻页链接
  28.     'obj("info") 为文章统计信息
  29.     'obj("cnt") 为文章内容
  30.     '''''''''''''''''''''''''''
  31.     'sample call:
  32.     '''''''''''''
  33.     '    dim rs, dic
  34.     '    set rs=createObject("adodb.recordset")
  35.     '        rs.open "select * from ctat where aid=15783",conn
  36.     '        
  37.     '        set dic=fAtPgnt(rs("content"),50000,request.queryString("apid"))
  38.     '            response.write dic("pgnt")&"<br/>"
  39.     '            response.write dic("info")&"<br/>"
  40.     '            response.write dic("cnt")&"<br/>"
  41.     '        set dic=nothing
  42.     '        
  43.     '        rs.close
  44.     '    set rs=nothing
  45.     ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  46.         if isNumeric(pSize)=false or len(aStr)=0 then exit function
  47.         if isNull(rId) or rId="" or isNumeric(rId)=false then rId=1 '如果分页查询ID为空则 ID为 1
  48.         
  49.         dim aStrLen '取文章总长度的变量
  50.             aStrLen=len(aStr)
  51.         
  52.         '智能URL字符串替换
  53.         dim rqs, url, rName
  54.             rqs=request.ServerVariables("QUERY_STRING")
  55.             rName="apid"
  56.         if rqs="" then
  57.             url="?"&rName&"="
  58.         elseif instr(rqs,rName)<>0 then    
  59.             url="?"&replace(rqs,rName&"="&rId,"")&rName&"=" 
  60.         else
  61.             url="?"&replace(rqs,"&"&rName&"="&rId,"")&"&"&rName&"="
  62.         end if
  63.         
  64.         dim tPg '定义总页数变量
  65.             tPg=int(aStrLen/-pSize)*-1
  66.             
  67.         if rId<1 then rId=1 '如果分页查询ID小于1, 则为1
  68.         if cLng(rId)>cLng(tPg) then rId=tPg '如果分页查询ID大于总页数, 则为总页数
  69.             
  70.         dim cPg '定义取当前页字符起始位置变量
  71.         if rId=1 then cPg=1 else cPg=pSize*(rId-1)+1 '读取文章的起始位置
  72.  
  73.         dim dic '定义字典变量
  74.         set dic = createObject("scripting.dictionary")
  75.             if aStrLen<=pSize then '如果分页大小大于正文大小时, 执行以下操作
  76.                 dic.add "pgnt", "" '增加页面链接到字典
  77.                     
  78.                 '增加统计信息到字典
  79.                 dic.add "info", formatNumber(pSize,0)&"字/页 "&rid&"/"&tPg&"页 共"&_
  80.                 formatNumber(aStrLen,0)&"字"
  81.                 
  82.                 dic.add "cnt", mid(aStr,1) '增加内容到字典
  83.                 set fAtPgnt=dic
  84.                 set dic=nothing
  85.                 exit function
  86.             end if
  87.         
  88.             dim i, temp, temp1
  89.             for i=1 to tPg
  90.                 '如果当前查询ID=i, 则加入高亮CSS类
  91.                 if strComp(rId,i,1)=0 then temp1=" class=""hl"""
  92.                 temp=temp&"<a href="""&url&i&""""&temp1&">第"&i&"页</a> "
  93.             next 
  94.             
  95.             dic.add "pgnt", temp '增加页面链接到字典
  96.                 
  97.             '增加统计信息到字典
  98.             dic.add "info", formatNumber(pSize,0)&"字/页 "&rId&"/"&tPg&"页 共"&_
  99.             formatNumber(aStrLen,0)&"字"
  100.             
  101.             dic.add "cnt", mid(aStr,cPg,pSize) '增加文章内容到字典
  102.         set fAtPgnt=dic
  103.         set dic=nothing
  104.     end function 'shawl.qiu code'
  105. %>


发表于 @ 2006年09月04日 10:54:00|评论(loading...)|编辑

新一篇: ASP 无重复数字随机函数, 数组实现, 并应用于随机显示记录集 By shawl.qiu | 旧一篇: 在 Access 里使用查询建立 存储过程/视图, 并使用 ASP 执行 By shawl.qiu

评论:没有评论。

发表评论  


登录
Csdn Blog version 3.1a
Copyright © shawl.qiu