看过好多分页程序,很麻烦,自己写了个,拿出来让高手帮忙提点建议
asp吧
全部回复
仅看楼主
level 1
看过好多分页程序,很麻烦,自己写了个,拿出来让高手帮忙提点建议!!function AUTOPage(rs,page) bb=Request.ServerVariables("QUERY_STRING") if instr(bb,"page=")>0 then '前半部分 a=split(bb,"page=") if instr(trim(a(0)),"&")>0 then a(0)=split(a(0),"&") for i=0 to ubound(a(0))-1 if trim(a(0)(i))<>"" then if cc1="" then cc1=a(0)(i) else cc1=cc1&"&"&a(0)(i) end if next end if if instr(trim(a(1)),"&")>0 then'后半部分 a(1)=split(a(1),"&") for i=1 to ubound(a(1)) if trim(a(1)(i))<>"" then if cc="" then cc=a(1)(i) else cc=cc&"&"&a(1)(i) end if next end if if trim(cc1)="" then bb=cc if trim(cc)="" then bb=cc1 if trim(cc1)<>"" and trim(cc)<>"" then bb=cc1&"&"&cc if trim(cc1)="" and trim(cc)="" then bb="" end if autopage=replace(LPzong,"$n$",rs.recordcount)&" "&replace(LPmeiyexianshi,"$n$",rs.pagesize)&" "&replace(replace(LPdangqian,"$n2$",rs.pagecount),"$n1$",page) if page<=1 then autopage=autopage&" ["&LPdiyiye&"] " else autopage=autopage&" ["&LPdiyiye&"] " end if if page<=1 then autopage=autopage&" ["&LPshangyiye&"] " else autopage=autopage&" ["&LPshangyiye&"] " end if if page>=rs.pagecount then autopage=autopage&" ["&LPxiayiye&"] " else autopage=autopage&" ["&LPxiayiye&"] " end if if page>=rs.pagecount then autopage=autopage&" ["&LPweiye&"] " else autopage=autopage&" ["&LPweiye&"] " end if end function 怎么调用就不用说了吧?? 有高手指点一下,QQ:75716953 LPzong=" 共$n$条记录 "'记录总数 (其中“$n$”为变量,视为数字,不要动!下同) LPmeiyexianshi=" 每页显示$n$条 "'每页显示 (其中“$n$”为变量,视为数字,不要动!下同) LPdangqian=" 当前$n1$/$n2$页 "'当前页数 (其中“$n$”为变量,视为数字,不要动!下同) LPdiyiye="第一页"'第一页 LPshangyiye="上一页"'上一页 LPxiayiye="下一页 "'下一页 LPweiye="最后一页"'最后一页 
2006年01月20日 02点01分 1
level 0
变量命名不舒服,aa,bb的
2006年01月20日 05点01分 2
1