<%
'Nombre: Versión redundante de la función de colección general ASP, aquellos que desean modificar la versión de alta calidad en sí mismos
'Autor: Liu Yongfa
'Fecha: 2007-6-23
Functiongethttppage (ruta)
t = getBody (ruta)
gethttppage = bytestobstr (t, "GB2312")
Función final
FunctionGetBody (URL)
OnerrorResumEnext
Setxmlhttp = createObject ("Microsoft.xmlhttp")
Withxmlhttp
.Preen "Get", url, falso, "", ""
.Enviar
.waitforResponse1000
GetBody = .ResponseBody
Fin
Setxmlhttp = nada
Función final
FunctionByTestObstr (Body, CSET)
OnerrorResumEnext
Dimobjstream
Setobjstream = server.createObject ("ADODB.Stream")
objstream.type = 1
objstream.mode = 3
objstream.
objstream.WriteBody
objstream.position = 0
objstream.type = 2
objstream.charset = cset
Bytestobstr = objstream.readText
objstream.close
Setobjstream = nada
Función final
Functiongethttpimg (URL)
OnerrorResumEnext
Dimxmlhttp
Setxmlhttp = server.createObject ("msxml2.xmlhttp")
xmlhttp.open "Get", URL, falso
xmlhttp.send ()
Ifxmlhttp.status <> 200 thenexitfunction
gethttpimg = xmlhttp.ResponseBody
Setxmlhttp = nada
Iferr.number <> 0thenerr.Clear
Función final
Functionsave2Local (de, tofile)
Dimgeturl, objstream, imgs
getURL = TRIM (de)
imgs = gethttpimg (getUrl)
Setobjstream = server.createObject ("ADODB.Stream")
objstream.type = 1
objstream.
objstream.writeimgs
objstream.savetofiletofile, 2