小偷程序2
程序员文章站
2023-11-17 20:51:16
复制代码 代码如下:<% dj54_path = "data/data.mdb" '数据库地址 set conn= ...
复制代码 代码如下:
<%
dj54_path = "data/data.mdb" '数据库地址
set conn= server.createobject("adodb.connection")
connstr = "provider=microsoft.jet.oledb.4.0;data source="&server.mappath(dj54_path)
conn.open connstr
function gethttppage(httpurl)
if isnull(httpurl)=true or httpurl="$false$" then
gethttppage="$false$"
exit function
end if
dim http
set http=server.createobject("msxml2.xmlhttp")
http.open "get",httpurl,false
http.send()
if http.readystate<>4 then
set http=nothing
gethttppage="$false$"
exit function
end if
gethttppage=bytestobstr(http.responsebody,"gb2312")
set http=nothing
if err.number<>0 then
err.clear
end if
end function
function bytestobstr(body,cset)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write body
objstream.position = 0
objstream.type = 2
objstream.charset = cset
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
function mymid(byval a_strstring,byval a_strpattern)
dim mm_objregexp
dim mm_strexecute
set mm_objregexp=new regexp
with mm_objregexp
.pattern=a_strpattern
.ignorecase=true
.global=false
set mm_strexecute=.execute(a_strstring)
if mm_strexecute.count<>0 then
mymid=mm_strexecute(0).submatches(0)
end if
end with
mymid=trim(mymid)
set mm_objregexp=nothing
end function
function reglistget(str,patrn,mysky)
set tempreg=new regexp
tempreg.ignorecase=false
tempreg.global=true
tempreg.pattern=patrn
set matches=tempreg.execute(str)
for each match in matches
content=content&match.value&mysky
next
reglistget=content
set matches=nothing
set tempreg=nothing
end function
dj54_sf = gethttppage("http://www.haosf.com/")
dj54_sf = replace(dj54_sf,vbcrlf,"")
dj54_sf = replace(dj54_sf,chr(10),"")
dj54_sf = trim(mymid(dj54_sf,"zjkf.asp"&chr(34)&"></script>(.+?)<script language=javascript src="&chr(34)&"txtj2.asp"&chr(34)&">"))
dj54_sf = reglistget(dj54_sf,"<script>o(.+?)</script>","bt54")
dj54_sf = replace(dj54_sf,"\","")
dj54_bt54_sf = split(dj54_sf,"bt54")
response.write "采集成功 共采集当日"&ubound(dj54_bt54_sf)-1 &"个sf<br/>"
set rs = server.createobject("adodb.recordset")
sql = "select * from sfdata"
rs.open sql,conn,1,3
for i =1 to ubound(dj54_bt54_sf)-1
sf = mid(dj54_bt54_sf(i),instr(dj54_bt54_sf(i),""&chr(34)&"")+1,len(dj54_bt54_sf(i))-48)
dj54_bt54_rsf = split(sf,""&chr(34)&","&chr(34)&"")
if len(dj54_bt54_rsf(2)) < 16 then
rs.addnew
sftime = trim(mymid(dj54_bt54_rsf(3),"日/(.+?)点"))
sftime = replace(sftime,"日/","")
sftime = replace(sftime,"点","")
rs("name") = dj54_bt54_rsf(1) '名称
rs("ip") = dj54_bt54_rsf(2)'ip
rs("sdate") = year(date) &"-"&month(date)&"-"&day(date) &" " & sftime &":00:00"
rs("xingzhi") = dj54_bt54_rsf(5)'性质
rs("email") = dj54_bt54_rsf(6)'qq
rs("homepage") = dj54_bt54_rsf(0)'网
rs("addtime") = now()
rs("gameid") = 28
rs("ulock") = 1
rs("service") = 2
rs("addr") = dj54_bt54_rsf(4)
end if
response.write dj54_bt54_rsf(1) & "入库成功!<br/>"
next
response.write "全部入库完成"
%>
推荐阅读
-
HTML5之SVG 2D入门7—SVG元素的重用与引用
-
HTML5之SVG 2D入门12—SVG DOM及DOM操作介绍
-
sqlserver中Case的使用方法(上下篇)第1/2页
-
HTML5之SVG 2D入门2—图形绘制(基本形状)介绍及使用
-
HTML5之SVG 2D入门5—颜色的表示及定义方式
-
HTML5之SVG 2D入门13—svg对决canvas及长处和适用场景分析
-
HTML5之SVG 2D入门8—文档结构及相关元素总结
-
HTML5之SVG 2D入门1—SVG(可缩放矢量图形)概述
-
HTML5之SVG 2D入门3—文本与图像及渲染文本介绍
-
HTML5之SVG 2D入门6—视窗坐标系与用户坐标系及变换概述