<%
'Name: ASP Allgemeine Sammlungsfunktion redundante Version, diejenigen, die die hochwertige Version selbst ändern möchten
'Autor: Liu Yongfa
'Datum: 2007-6-23
FunctionNeethttppage (Pfad)
T = Getbody (Pfad)
Gethttppage = byTestObstr (t, "gb2312")
Endfunktion
FunktionGetBody (URL)
OnErrorresumeNext
Setxmlhttp = createObject ("microsoft.xmlhttp"))
Withxmlhttp
.Open "GET", URL, falsch, "," ""
.Schicken
.waitforresponse1000
Getbody = .ResponseBody
Endwith
Setxmlhttp = nichts
Endfunktion
FunktionByTestObstr (Körper, cset)
OnErrorresumeNext
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
FunctionNeethttpimg (URL)
OnErrorresumeNext
Dimxmlhttp
Setxmlhttp = server.createObject ("msxml2.xmlhttp")
xmlhttp.open "get", url, false
xmlhttp.send ()
Ifxmlhttp.status <> 200Thenexitfunction
gethttpimg = xmlhttp.ResponseBody
Setxmlhttp = nichts
Ifer.number <> 0Thenerr.clear
Endfunktion
FunktionenSave2Local (from, toFile)
Dimgeturl, Objstream, IMGS
Geturl = trimm (von)
IMGS = Gethttpimg (Geturl)
SetObjstream = server.createObject ("adodb.stream")
objstream.type = 1
objstream.open
Objstream.WriteImgs
Objstream.Savetofiletofile, 2