<% @language = "VBScript" codepage= "936"%>
<%
Dim conn,rs,sqlstr,ip,iptime,iptime2,newuser
Newuser=0
Set conn = Server.CreateObject ("Adodb.connection")
Set Rs=server.createobject ("Adodb.recordset")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("Data.mdb")
Conn.Open ConnStr
Ip=request.servervariables ("REMOTE_ADDR")
Sqlstr= "SELECT * from [ip1] where ip1_address= '" &ip& "' ORDER BY ip1_id Desc"
Rs.Open sqlstr,conn,1,3
If Rs.eof Then
Newuser=1
Application.Lock ()
Rs.addnew ()
RS ("ip1_address") =ip
Rs.update ()
Phi Phi Learning Net Skin Network tutorial
Application.UnLock ()
Else
Iptime=rs ("Ip1_time")
Application.Lock ()
Rs.addnew ()
RS ("ip1_address") =ip
Rs.update ()
Application.UnLock ()
End If
Rs.close
If Newuser=0 Then
Sqlstr= "SELECT * from [IP2] where ip2_address= '" &ip& "' ORDER BY ip2_id Desc"
Rs.Open sqlstr,conn,1,3
If Rs.eof Then
Rs.close
Response.Write ("Do not collect!") ")
Response.End ()
Else
Iptime2=rs ("Ip2_time")
If DateDiff ("s", Iptime2,iptime) >10 Then
Rs.close
Response.Write ("Do not collect!") ")
Response.End ()
End If
End If
Rs.close
End If
%>
js.asp Tutorial
<%
Dim Conn,rs,sqlstr,ip
Set conn = Server.CreateObject ("Adodb.connection")
Set Rs=server.createobject ("Adodb.recordset")
Connstr= "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("Data.mdb")
Conn.Open ConnStr
Ip=request.servervariables ("REMOTE_ADDR")
Sqlstr= "SELECT * from [IP2]"
Rs.Open sqlstr,conn,1,3
Application.Lock ()
Rs.addnew ()
RS ("ip2_address") =ip
Rs.update ()
Application.UnLock ()
Rs.close
%> Skin and skin Learning Network IT course
4.get.asp
Leather Web Tutorial Network
<% @language = "VBScript" codepage= "936"%>
<%
Response.Write (Server.HTMLEncode (Gethttppage ("http://localhost/index.asp", "gb2312"))
'==============================
' Function name: gethttppage
' Function: Get page source code function
' Parameters: URL Httpurl
'==============================
function Gethttppage (Httpurl,code)
If IsNull (httpurl) =true or httpurl= "" Then
Gethttppage= "A site maintenance!" "
Exit function
End If
On Error Resume Next
Dim http
Set Http=server.createobject ("MSX" & "Ml2.xml" & "http")
Http.open "Get", Httpurl,false
Http.send ()
If Http.readystate<>4 Then
Phi Phi Learning Net Skin Network tutorial
Set http=nothing
gethttppage= "b Site maintenance!" "
Exit Function
End If
gethttppage=bytestobstr (http.responsebody,code)
Set http=nothing
If Err.number<>0 then
Err.Clear
gethttppage= "C Site maintenance!" "
Exit Function
End If
End Function
' ==============================
' function name: Bytestobstr
' function: Convert encoding function
' Parameters: String body, encoded CSET
' ==============================
function bytestobstr (body,cset)
Dim objstream
Set objstream = Server.CreateObject ("ADO" & "D" & "B.st" & "Re" & "AM")
objStream.Type = 1
Objstream.mode =3
objStream.Open
Objstream.write body
objstream.position = 0
objStream.Type = 2
Objst Ream.charset = Cset
Bytestobstr = Objstream.readtext
objStream.Close
Set objstream = Nothing
End Function
%>