复制代码代码如下:
<٪
dj54_path = "data/data.mdb" '数据库地址
setConn = server.createObject ("adodb.connection")
connstr = "provider = microsoft.jet.oledb.4.0 ؛ datasource =" & server.mappath (dj54_path)
Conn.Openconnstr
FunctionGethTpage (httpurl)
ifisnull (httpurl) = trueorhttpurl = "$ false $" ثم
gethttppage = "$ false $"
exitfunction
Endif
DIMHTTP
sethttp = server.createBject ("msxml2.xmlhttp")
http.open "get" ، httpurl ، false
http.send ()
ifhttp.readyState <> 4then
sethttp = لا شيء
gethttppage = "$ false $"
exitfunction
Endif
gethttppage = bytestobstr (http.responsebody ، "GB2312")
sethttp = لا شيء
iferr.number <> 0then
err.clear
Endif
الوظيفية
FunctionByTestobstr (الجسم ، CSET)
Dimobjstream
setObjStream = server.createBject ("Adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.Open
objstream.writeBody
objstream.position = 0
objstream.type = 2
objstream.charset = cset
bytestobstr = objstream.readtext
objstream.close
setObjStream = لا شيء
الوظيفية
functionMymid (byvala_strstring ، byvala_strpattern)
dimmm_objregexp
dimmm_strexecute
setmm_objregexp = newregexp
withmm_objregexp
.pattern = a_strpattern
.InsoreCase = صحيح
.global = خطأ
setmm_strexecute = .execute (a_strstring)
ifmm_strexecute.count <> 0then
mymid = mm_strexecute (0) .submatches (0)
Endif
endwith
mymid = trim (mymid)
setmm_objregexp = لا شيء
الوظيفية
FunctionregListget (Str ، Gatrn ، Mysky)
Settempreg = NewRegexp
tempreg.ignorecase = false
tempreg.global = صحيح
tempreg.pattern = patrn
setMatches = tempreg.execute (str)
foreachMatchinMatches
content = content & match.value & mysky
التالي
RegListget = المحتوى
setMatches = لا شيء
Settempreg = لا شيء
الوظيفية
dj54_sf = gethttppage ("http://www.haosf.com/")
DJ54_SF = استبدال (DJ54_SF ، VBCRLF ، "")
DJ54_SF = استبدال (DJ54_SF ، CHR (10) ، "")
dj54_sf = trim (mymid (dj54_sf ، "zjkf.asp" & chr (34) & "> </script> (.
dj54_sf = reglistget (dj54_sf ، "<script> o (.+؟) </script>" ، "BT54")
dj54_sf = استبدال (dj54_sf ، "/" ، "")
dj54_bt54_sf = split (dj54_sf ، "BT54")
Response.write "采集成功 共 采集当日" & ubound (dj54_bt54_sf) -1 & "个 sf <br/>"
setRs = server.createObject ("adodb.recordset")
SQL = "SELECT*FROMSFDATA"