📄 index_count.asp
字号:
<%
Dim RsArticleCount
Dim RsArticleCount_numRows
Set RsArticleCount = Server.CreateObject("ADODB.Recordset")
RsArticleCount.ActiveConnection = MM_connDB_STRING
RsArticleCount.Source = "SELECT fID_ArticleContent FROM tArticleContent"
RsArticleCount.CursorType = 0
RsArticleCount.CursorLocation = 2
RsArticleCount.LockType = 1
RsArticleCount.Open()
RsArticleCount_numRows = 0
%>
<%
Dim RsSoftCount
Dim RsSoftCount_numRows
Set RsSoftCount = Server.CreateObject("ADODB.Recordset")
RsSoftCount.ActiveConnection = MM_connDB_STRING
RsSoftCount.Source = "SELECT fSoftID FROM tSoft"
RsSoftCount.CursorType = 0
RsSoftCount.CursorLocation = 2
RsSoftCount.LockType = 1
RsSoftCount.Open()
RsSoftCount_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim RsArticleCount_total
Dim RsArticleCount_first
Dim RsArticleCount_last
' set the record count
RsArticleCount_total = RsArticleCount.RecordCount
' set the number of rows displayed on this page
If (RsArticleCount_numRows < 0) Then
RsArticleCount_numRows = RsArticleCount_total
Elseif (RsArticleCount_numRows = 0) Then
RsArticleCount_numRows = 1
End If
' set the first and last displayed record
RsArticleCount_first = 1
RsArticleCount_last = RsArticleCount_first + RsArticleCount_numRows - 1
' if we have the correct record count, check the other stats
If (RsArticleCount_total <> -1) Then
If (RsArticleCount_first > RsArticleCount_total) Then
RsArticleCount_first = RsArticleCount_total
End If
If (RsArticleCount_last > RsArticleCount_total) Then
RsArticleCount_last = RsArticleCount_total
End If
If (RsArticleCount_numRows > RsArticleCount_total) Then
RsArticleCount_numRows = RsArticleCount_total
End If
End If
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim RsSoftCount_total
Dim RsSoftCount_first
Dim RsSoftCount_last
' set the record count
RsSoftCount_total = RsSoftCount.RecordCount
' set the number of rows displayed on this page
If (RsSoftCount_numRows < 0) Then
RsSoftCount_numRows = RsSoftCount_total
Elseif (RsSoftCount_numRows = 0) Then
RsSoftCount_numRows = 1
End If
' set the first and last displayed record
RsSoftCount_first = 1
RsSoftCount_last = RsSoftCount_first + RsSoftCount_numRows - 1
' if we have the correct record count, check the other stats
If (RsSoftCount_total <> -1) Then
If (RsSoftCount_first > RsSoftCount_total) Then
RsSoftCount_first = RsSoftCount_total
End If
If (RsSoftCount_last > RsSoftCount_total) Then
RsSoftCount_last = RsSoftCount_total
End If
If (RsSoftCount_numRows > RsSoftCount_total) Then
RsSoftCount_numRows = RsSoftCount_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (RsArticleCount_total = -1) Then
' count the total records by iterating through the recordset
RsArticleCount_total=0
While (Not RsArticleCount.EOF)
RsArticleCount_total = RsArticleCount_total + 1
RsArticleCount.MoveNext
Wend
' reset the cursor to the beginning
If (RsArticleCount.CursorType > 0) Then
RsArticleCount.MoveFirst
Else
RsArticleCount.Requery
End If
' set the number of rows displayed on this page
If (RsArticleCount_numRows < 0 Or RsArticleCount_numRows > RsArticleCount_total) Then
RsArticleCount_numRows = RsArticleCount_total
End If
' set the first and last displayed record
RsArticleCount_first = 1
RsArticleCount_last = RsArticleCount_first + RsArticleCount_numRows - 1
If (RsArticleCount_first > RsArticleCount_total) Then
RsArticleCount_first = RsArticleCount_total
End If
If (RsArticleCount_last > RsArticleCount_total) Then
RsArticleCount_last = RsArticleCount_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (RsSoftCount_total = -1) Then
' count the total records by iterating through the recordset
RsSoftCount_total=0
While (Not RsSoftCount.EOF)
RsSoftCount_total = RsSoftCount_total + 1
RsSoftCount.MoveNext
Wend
' reset the cursor to the beginning
If (RsSoftCount.CursorType > 0) Then
RsSoftCount.MoveFirst
Else
RsSoftCount.Requery
End If
' set the number of rows displayed on this page
If (RsSoftCount_numRows < 0 Or RsSoftCount_numRows > RsSoftCount_total) Then
RsSoftCount_numRows = RsSoftCount_total
End If
' set the first and last displayed record
RsSoftCount_first = 1
RsSoftCount_last = RsSoftCount_first + RsSoftCount_numRows - 1
If (RsSoftCount_first > RsSoftCount_total) Then
RsSoftCount_first = RsSoftCount_total
End If
If (RsSoftCount_last > RsSoftCount_total) Then
RsSoftCount_last = RsSoftCount_total
End If
End If
%>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR>
<TD background=images/index1_2.gif><IMG height=41
src="images/index1_1.gif" width=16></TD>
<TD><IMG height=41 src="images/index1_2.gif"
width=10></TD>
<TD width=89 background=images/index1_2.gif height=41>本站统计</TD>
<TD background=images/index1_5.gif><IMG height=41 src="images/index1_4.gif" width=30></TD>
<TD width=140 background=images/index1_5.gif></TD>
<TD><IMG height=41 src="images/index1_7.gif" width=14></TD></TR>
<TR>
<TD background=images/index1_8.gif> </TD>
<TD vAlign=top background=images/index1_9.gif colSpan=4>
<TABLE width="90%"
border=0 align="center" cellPadding=1 cellSpacing=0 >
<TR>
<TD width="8%"><div align="center"><strong>•</strong></div></TD>
<TD width="92%">文章总数: <span class="redtext"><%=(RsArticleCount_total)%></span> 篇</TD>
</TR>
<TR>
<TD><div align="center"><strong>•</strong></div></TD>
<TD>下载总数: <span class="redtext"><%=(RsSoftCount_total)%></span> 个</TD>
</TR>
<TR>
<TD> </TD>
<TD> </TD>
</TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TR align=middle>
<TD width="33%">
</TD>
</TABLE></TD>
<TD background=images/index1_10.gif> </TD>
</TR>
<TR>
<TD><IMG height=18 src="images/index1_11.gif"
width=16></TD>
<TD width=250 background=images/index1_12.gif
colSpan=4></TD>
<TD><IMG height=18 src="images/index1_13.gif"
width=14></TD></TR></TABLE>
<%
RsArticleCount.Close()
Set RsArticleCount = Nothing
%>
<%
RsSoftCount.Close()
Set RsSoftCount = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -