复制代码代码如下::
<%
Dj54_path = "data/data.mdb" '数据库地址
SetConn = server.createObject ("adodb.Connection")
connstr = "Provider = microsoft.jet.oledb.4.0; dataSource =" & server.mappath (DJ54_Path)
Conn.openconnstr
FunctionNeethttppage (httpurl)
Ifisnull (httpurl) = truorhttpurl = "$ false $" dann
Gethttppage = "$ false $"
Ausgangsfunktion
Endif
Dimhttp
Sethttp = server.createObject ("msxml2.xmlhttp"))
Http.open "get", httpurl, false
Http.send ()
IFHTTP.REYYSTATE <> 4Then
Sethttp = nichts
Gethttppage = "$ false $"
Ausgangsfunktion
Endif
Getttppage = byTestObstr (http.Responsebody, "GB2312")
Sethttp = nichts
Ifr.number <> 0Then
Err.clear
Endif
Endfunktion
FunktionByTestObstr (Körper, cset)
Dimobjstream
SetObjstream = server.createObject ("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 = nichts
Endfunktion
functionmymid (Byvala_strstring, Byvala_Strppattern)
DIMMM_OBJREGEXP
dimmm_strexecute
setmm_objregexp = newregexp
mit MMM_OBJREGEXP
.Pattern = a_strpattern
.Innorecase = true
.Global = false
setmm_strexecute = .execute (a_strstring)
IFMM_Strexecute.count <> 0Then
MYMID = mm_strexecute (0) .Submatches (0)
Endif
Endwith
MYMID = Trimm (MYMID)
setmm_objregexp = nichts
Endfunktion
FunktionRlistget (STR, Patrn, Mysky)
settempreg = newRegExp
tempreg.ignorecase = false
tempreg.global = true
tempreg.pattern = patrn
setMatches = tempreg.execute (str)
foreachMatchInmatches
content = content & match.value & mysky
nächste
Reglistget = Inhalt
setMatches = nichts
settempreg = nichts
Endfunktion
DJ54_SF = Gethttppage ("http://www.haosf.com/")
Dj54_sf = ersetzen (dj54_sf, vbcrlf, "")
Dj54_sf = ersetzen (dj54_sf, chr (10), "")
Dj54_sf = trim (MYMID (DJ54_SF, "ZJKF.asp" & chr (34) & "> </script> (.+?) <ScriptUloage = javascriptsrc =" & chr (34) & "txtj2.asp" & chr (34) & ">")))))))))))))))))))))))
DJ54_SF = Reglistget (DJ54_SF, "<Script> o (.+?) </Script>", "BT54")
Dj54_sf = ersetzen (dj54_sf, "/", "")
DJ54_BT54_SF = Split (DJ54_SF, "BT54")
Antwort.Write "采集成功 共 采集当日" & Ubound (DJ54_BT54_SF) -1 & "个 SF <br/>"
setrs = server.createObject ("adodb.recordset")
Sql = "Auswählen*aus sfdata"