Online IP Address
Features: Displays the current number of online Web pages and IP addresses.
Methods: The current Web page online IP address into the people.asp, every one-minute automatic refresh, used to calculate the current page number of online and IP address.
1: The current online IP address and access time into the LY array.
Set Thisfile=streamf.opentextfile (Countfile,1,false)
Countly=0
Do as not Thisfile.atendofstream
Thisline = Thisfile.readline
' Using the Preserve keyword, you can only resize the last dimension of the array, and you cannot change the dimension of the array.
' The array has only one dimension, and the dimension is the last and only one, you can modify the size of the array.
Redim Preserve ly (countly)
Ly (countly) = Thisline
' Countly records the number of thisfile lines
countly = countly + 1
Loop
Thisfile.close
2: Start refreshing access to the current page IP address
Current system time stored in SJ
Sameip=0
For I=1 to (Countly-1)/2
' Get even sequence
' If the online IP address and the current time are more than one minute, then the IP
If DateDiff ("s", Ly (I*2), SJ) >60 Then
Ly (i*2-1) = ""
Ly (i*2) = ""
Countly=countly-2
End If
' Get the IP address just online, if it's still online
' Request.ServerVariables (' remote_addr ') gets the IP that emits the requesting machine
If Request.ServerVariables ("REMOTE_ADDR") =ly (i*2-1) Then
Sameip=1
Ly (i*2) =SJ
End If
Next
3: The latest access to the current page of the IP address deposit people.asp
' Start writing data to people.asp this file
Set Outfile=streamf.createtextfile (Countfile)
For I=0 to Countly-1
If Ly (i) <> "" Then
Outfile.writeline ly (i)
End If
Next
If Sameip=0 Then
Outfile.writeline Request.ServerVariables ("REMOTE_ADDR")
Outfile.writeline SJ
Outfile.close
End If