sub showpage(sfilename,totalnumber,maxperpage,ShowTotal,ShowAllPages,strUnit)
if totalnumber>0 then
dim n, i,strTemp,strUrl
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
strTemp=strTemp & "共 <font color=blue><b>" & totalnumber & "</b></font> " & strUnit & " "
strUrl=JoinChar(sfilename)
if PageNo<2 then
strTemp=strTemp & "首页 上一页 "
else
strTemp=strTemp & "<a href='" & strUrl & "PageNo=1'>首页</a> "
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & (PageNo-1) & "'>上一页</a> "
end if
dim p,pp,pno
pp=PageNo-3
if pp<1 then
pp=1
end if
for pno=pp to n
p=p+1
if pno=PageNo then
strTemp=strTemp& "<b><font color=#FF0000>["&pno&"]</font></b> "
else
strTemp=strTemp& "<b><a href='" & strUrl & "PageNo="&pno&"'>["&pno&"]</a></b> "
end if
if p>=6 then exit for
next
if n-PageNo<1 then
strTemp=strTemp & "下一页 尾页"
else
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & (PageNo+1) & "'>下一页</a> "
strTemp=strTemp & "<a href='" & strUrl & "PageNo=" & n & "'>尾页</a>"
end if
strTemp=strTemp & " 页次:<strong><font color=red>" & PageNo & "</font>/" & n & "</strong>页 "
strTemp=strTemp & " <b>" & maxperpage & "</b>" & strUnit & "/页"
if ShowAllPages=True then
strTemp=strTemp & " 转到:<select name='page' size='1' onchange=""javascript:window.location='" & strUrl & "PageNo=" & "'+this.options[this.selectedIndex].value;"">"
for i = 1 to n
strTemp=strTemp & "<option value='" & i & "'"
if cint(PageNo)=cint(i) then strTemp=strTemp & " selected "
strTemp=strTemp & ">第" & i & "页</option>"
next
strTemp=strTemp & "</select>"
end if
response.write strTemp
end if
end sub
中国人的财富网:http://www..cn/