%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> <% if(Request.ServerVariables("REMOTE_ADDR") <> "") then Command1__USR_IP = Request.ServerVariables("REMOTE_ADDR") %> <% Dim Recordcount Dim Recordcount_numRows Set Recordcount = Server.CreateObject("ADODB.Recordset") Recordcount.ActiveConnection = MM_conncounter_STRING Recordcount.Source = "SELECT * FROM webCount" Recordcount.CursorType = 0 Recordcount.CursorLocation = 2 Recordcount.LockType = 1 Recordcount.Open() Recordcount_numRows = 0 %> <% if Session("countOK")<>1 then set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = MM_conncounter_STRING Command1.CommandText = "INSERT INTO webCount (count_ip) VALUES ('" + Replace(Command1__USR_IP, "'", "''") + "') " Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute() Session("countOK")=1 end if %> <% Dim Recordtodaycount Dim Recordtodaycount_numRows Set Recordtodaycount = Server.CreateObject("ADODB.Recordset") Recordtodaycount.ActiveConnection = MM_conncounter_STRING Recordtodaycount.Source = "SELECT * FROM showcount" Recordtodaycount.CursorType = 0 Recordtodaycount.CursorLocation = 2 Recordtodaycount.LockType = 1 Recordtodaycount.Open() Recordtodaycount_numRows = 0 %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Recordcount_total Dim Recordcount_first Dim Recordcount_last ' set the record count Recordcount_total = Recordcount.RecordCount ' set the number of rows displayed on this page If (Recordcount_numRows < 0) Then Recordcount_numRows = Recordcount_total Elseif (Recordcount_numRows = 0) Then Recordcount_numRows = 1 End If ' set the first and last displayed record Recordcount_first = 1 Recordcount_last = Recordcount_first + Recordcount_numRows - 1 ' if we have the correct record count, check the other stats If (Recordcount_total <> -1) Then If (Recordcount_first > Recordcount_total) Then Recordcount_first = Recordcount_total End If If (Recordcount_last > Recordcount_total) Then Recordcount_last = Recordcount_total End If If (Recordcount_numRows > Recordcount_total) Then Recordcount_numRows = Recordcount_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Recordcount_total = -1) Then ' count the total records by iterating through the recordset Recordcount_total=0 While (Not Recordcount.EOF) Recordcount_total = Recordcount_total + 1 Recordcount.MoveNext Wend ' reset the cursor to the beginning If (Recordcount.CursorType > 0) Then Recordcount.MoveFirst Else Recordcount.Requery End If ' set the number of rows displayed on this page If (Recordcount_numRows < 0 Or Recordcount_numRows > Recordcount_total) Then Recordcount_numRows = Recordcount_total End If ' set the first and last displayed record Recordcount_first = 1 Recordcount_last = Recordcount_first + Recordcount_numRows - 1 If (Recordcount_first > Recordcount_total) Then Recordcount_first = Recordcount_total End If If (Recordcount_last > Recordcount_total) Then Recordcount_last = Recordcount_total End If End If %> <% Dim RefreshTime, IdleTime, TotalUsers, OnlineUser(), Tmp(), Num, I, ID RefreshTime = 30 IdleTime = RefreshTime * 3 Application.Lock If Application(Session.SessionID & "LastAccessTime") = Empty Then If Application("TotalUsers") = Empty Then Application("TotalUsers") = 0 ReDim Tmp(Application("TotalUsers") + 1) Num = 0 If Application("TotalUsers") > 0 Then For I = LBOUND(Application("OnlineUser")) To UBOUND(Application("OnlineUser")) ID = Application("OnlineUser")(I) If ID <> Session.SessionID Then Tmp(Num) = ID Num = Num + 1 End If Next End If Tmp(Num) = Session.SessionID Application("TotalUsers") = Num + 1 ReDim Preserve Tmp(Application("TotalUsers")) Application("OnlineUser") = Tmp End If Application(Session.SessionID & "LastAccessTime") = Timer ReDim Tmp(Application("TotalUsers")) Num = 0 For I = 0 To Application("TotalUsers") - 1 ID = Application("OnlineUser")(I) If (Timer - Application(ID & "LastAccessTime")) < IdleTime Then Tmp(Num) = ID Num = Num + 1 Else Application(ID & "LastAccessTime") = Empty End If Next If Num <> Application("TotalUsers") Then ReDim Preserve Tmp(Num) Application("OnlineUser") = Tmp Application("TotalUsers") = Num End If Application.UnLock %>
![]() |
||||||
![]() |
|
|||||
| 聯絡地址:110 臺北市信義區忠孝東路五段236巷15號(民生樓) | TEL:(02)2722-6616 分機561~565 (一覽表) | |||||
| 網頁管理者:王守成 |
||||||