ÊÖ»úÕ¾
ÍøÍ¨·ÖÕ¾
µçÐÅÖ÷Õ¾
ÃÜ¡¡Âë:
Óû§Ãû£º
µ±Ç°Î»Öà : Ö÷Ò³>ÍøÂç±à³Ì>Asp±à³Ì>Áбí

Ö§³Ö¶à·ç¸ñ±ä»»µÄASP·ÖÒ³Àà

À´Ô´£º»¥ÁªÍø ×÷Õߣºwest263.com ʱ¼ä£º2008-02-23
Î÷²¿ÊýÂë-È«¹úÐéÄâÖ÷»ú10Ç¿£¡40ÓàÏîÐéÄâÖ÷»ú¹ÜÀí¹¦ÄÜ,È«¹úÁìÏÈ!Ë«Ïß¶àÏßÐéÄâÖ÷»úÄϱ±·ÃÎʳ©Í¨ÎÞ×è!Ãâ·ÑÔùËÍÆóÒµÓʾÖ,.CNÓòÃû,×ÔÖú½¨Õ¾480ÔªÆð,Ãâ·ÑÊÔÓÃ7Ìì,ÂúÒâÔÙ¸¶¿î! P4Ö÷»ú×âÓÃ799Ôª/ÔÂ.Ô¸¶Ãâѹ½ð!

Õâ¸ö·ÖҳʹÓõÄÊÇ0Óα꣬Ҳ¾ÍÊÇRs.Open Sql,Conn,0,1¡£µ«ÊǸоõÒ²¿ì²»Á˶àÉÙ£¬10
ÍòÌõÊý¾ÝµÄ·Öҳʱ¼ä300¶àºÀÃëÖ®¼ä
<%
Class Page
Private CurrPage
Private PageN
Private UrlStr
Private TempStr
Private ErrInfo
Private IsErr
Private TotalRecord
Private TotalPage
Public PageRs

Private TempA(11)
Private TempB(8)
'------------------------------------------------------------
Private Sub Class_Initialize()
CurrPage=1'//ĬÈÏÏÔʾµ±Ç°Ò³ÎªµÚÒ»Ò³
PageN=10'//ĬÈÏÿҳÏÔʾ10ÌõÊý¾Ý
UrlStr="#"
TempStr=""
ErrInfo="ErrInfo:"
IsErr=False
End Sub
Private Sub Class_Terminate()
If IsObject(PageRs) Then
PageRs.Close
Set PageRs=Nothing
End If
Erase TempA
Erase TempB
End Sub
'----------------------------------------------------------
'//»ñÈ¡µ±Ç°Ò³Âë
Public Property Let CurrentPage(Val)
CurrPage=Val
End Property
Public Property Get CurrentPage()
CurrentPage=CurrPage
End Property
'//»ñȡÿҳÏÔʾÌõÊý
Public Property Let PageNum(Val)
PageN=Val
End Property
Public Property Get PageNum()
PageNum=PageN
End Property
'//»ñÈ¡URL
Public Property Let Url(Val)
UrlStr=Val
End Property
Public Property Get Url()
Url=UrlStr
End Property
'//»ñȡģ°å
Public Property Let Temp(Val)
TempStr=Val
End Property
Public Property Get Temp()
Temp=TempStr
End Property
'------------------------------------------------------------

Public Sub Exec(Sql,ConnObj)
On Error Resume Next
Set PageRs=Server.CreateObject("ADODB.RecordSet")
PageRs.CursorLocation = 3 'ʹÓÿͻ§¶ËÓα꣬¿ÉÒÔʹЧÂÊÌá¸ß
PageRs.PageSize = PageN '¶¨Òå·ÖÒ³¼Ç¼¼¯Ã¿Ò³ÏÔʾ¼Ç¼Êý
PageRs.Open Sql,ConnObj,0,1
If Err.Number<>0 Then
Err.Clear
PageRs.Close
Set PageRs=Nothing
ErrInfo=ErrInfo&"½¨Á¢»ò´ò¿ª¼Ç¼¼¯´íÎó..."
IsErr=True
Response.Write ErrInfo
Response.End
End If
TotalRecord=PageRs.RecordCount'//Èç¹ûΪ0ÄØ£¿
If TotalRecord>=1 Then
'----------------------------------------------------------------------------¿ªÊ¼
'//¼ÆËã×ÜÒ³Êý,Ps,Ϊʲô²»ÓÃPageRs.PageCountÄØ£¿
'If TotalRecord Mod PageN=0 Then
'TotalPage=PageRs.RecordCount\PageN
'Else
'TotalPage=PageRs.RecordCount\PageN
'TotalPage=Abs(Int(TotalPage))
'End If
TotalPage=PageRs.PageCount
'//´¦Àíµ±Ç°½ÓÊÕÒ³Âë,ĬÈϵÄΪ1£¬ËùÒÔ²»ÊÇÊý×ÖÀàÐ͵ͼ»áΪ1
If IsNumeric(CurrPage) Then
CurrPage=CLNg(CurrPage)
If CurrPage<1 Then CurrPage=1
If CurrPage>TotalPage Then CurrPage=TotalPage
Else
'//Dim M:M="":IsNumeric(M)=True
CurrPage=1
End If
'---------------------------------------------------------------------------½áÊø
Else
TotalPage=0
CurrPage=1
End If
'//
PageRs.AbsolutePage = CurrPage 'absolutepage£ºÉèÖÃÖ¸ÕëÖ¸Ïòijҳ¿ªÍ·
PageRs.PageSize=PageN
End Sub
Private Sub Init()
'Private TempA(10)
TempA(1)="{N1}" '//Ê×Ò³
TempA(2)="{N2}"'//ÉÏÒ»Ò³
TempA(3)="{N3}"'//ÏÂÒ»Ò³
TempA(4)="{N4}"'//βҳ
TempA(5)="{N5}"'//µ±Ç°Ò³Âë
TempA(6)="{N6}"'//Ò³Âë×ÜÊý
TempA(7)="{N7}"'//ÿҳÌõÊý
TempA(8)="{N8}"'//ÎÄÕÂ×ÜÊý
TempA(9)="{L}"'//Ñ­»·±êÇ©¿ªÊ¼
TempA(10)="{N}"'//Ñ­»·ÄÚµ¥±êÇ©£ºÒ³Âë
TempA(11)="{L/}"'//Ñ­»·±êÇ©½áÊø
'Private TempB(8)
TempB(1)="Ê×Ò³"
TempB(2)="ÉÏÒ»Ò³"
TempB(3)="ÏÂÒ»Ò³"
TempB(4)="βҳ"
TempB(5)=CurrPage'//µ±Ç°Ò³Âë
TempB(6)=TotalPage'//Ò³Âë×ÜÊý
TempB(7)=PageN'//ÿҳÌõÊý
TempB(8)=TotalRecord'//ÎÄÕÂ×ÜÊý
End Sub
Public Sub Show(Style)
If IsErr=True Then
Response.Write ErrInfo
Exit Sub
End If

Call Init()
Select Case Style
Case 1
Response.Write StyleA()
Case 2
Response.Write StyleB()
Case 3
Response.Write StyleC()
Case 4
Response.Write StyleD()
Case Else
ErrInfo=ErrInfo&"²»´æÔÚµ±Ç°Ñùʽ..."
Response.Write ErrInfo
End Select
End Sub
Public Function ShowStyle(Style)
If IsErr=True Then
ShowStyle=ErrInfo
Exit Function
End If

Call Init()
Select Case Style
Case 1
ShowStyle= StyleA()
Case 2
ShowStyle= StyleB()
Case Else
ErrInfo=ErrInfo&"²»´æÔÚµ±Ç°Ñùʽ..."
ShowStyle=ErrInfo
End Select
End Function

Private Function StyleA()
'Ê×Ò³ ÉÏÒ»Ò³ ÏÂÒ»Ò³ βҳ ±¾Ò³ÎªµÚ1/20Ò³£¬¹²20Ò³£¬Ã¿Ò³10Ìõ£¬ÎÄÕÂ×ÜÊý200Ìõ
'//·ÖÒ³ÑùÀý£º[Ê×Ò³] [ÉÏÒ³] [ÏÂÒ³] [βҳ] [Ò³´Î£º4/5Ò³] [¹²86ƪ 20ƪ/Ò³] תµ½£º_ Ò³

ÎÄÕÂÕûÀí£ºÎ÷²¿ÊýÂë--רҵÌṩÓòÃû×¢²á¡¢ÐéÄâÖ÷»ú·þÎñ
http://www.west263.com
ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúÒª×ªÔØ±¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!