首页 > 网站 > 建站经验 > 正文

asp动态页面防_采集的新方法

2019-11-02 15:30:09
字体:
来源:转载
供稿:网友

<[email protected]="VBSCRIPT" CODEPAGE="936"%>
<%
Response.Write(Server.HTMLEncode(GetHttpPage("http://localhost/Index.asp教程","GB2312")))
==============================
函 数 名:GetHttpPage
作 用:获取页面源代码函数
参 数:网址HttpUrl
==============================
Function GetHttpPage(HttpUrl,Code)
If IsNull(HttpUrl)=True Or HttpUrl="" Then
GetHttpPage="A站点维护中!"
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
Set Http=Nothing
GetHttpPage="B站点维护中!"
Exit function
End if
GetHttpPage=BytesToBSTR(Http.responseBody,Code)
Set Http=Nothing
If Err.number<>0 then
Err.Clear
GetHttpPage="C站点维护中!"
Exit function
End If
End Function
==============================
函 数 名:BytesToBstr
作 用:转换编码函数
参 数:字符串Body,编码Cset
==============================
Function BytesToBstr(Body,Cset)
Dim Objstream
Set Objstream = Server.CreateObject("ado"&"d"&"b.st"&"re"&"am")
Objstream.Type = 1
Objstream.Mode =3

幽默笑话[www.62-6.com/1/gaoxiaoduanzi/]

Objstream.Open
Objstream.Write body
Objstream.Position = 0
Objstream.Type = 2
Objstream.Charset = Cset
BytesToBstr = Objstream.ReadText
Objstream.Close
set Objstream = nothing
End Function
%>
<%
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
%>
<[email protected]="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"
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表