<٪
'الاسم: ASP General Collection وظيفة زائدة عن الحاجة ، أولئك الذين يرغبون في تعديل الإصدار عالي الجودة بأنفسهم
المؤلف: ليو يونجفا
التاريخ: 2007-6-23
FunctionGethTtppage (المسار)
t = getBody (المسار)
gethtpage = bytestobstr (t ، "GB2312")
الوظيفية
FunctionGetBody (url)
onerrorresumenext
setXMLHTTP = createObject ("microsoft.xmlhttp")
withxmlhttp
.OPEN "Get" ، url ، false ، "" ، ""
.يرسل
.waitforresponse1000
getBody = .responseBody
endwith
setXMLHTTP = لا شيء
الوظيفية
FunctionByTestobstr (الجسم ، CSET)
onerrorresumenext
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 = لا شيء
الوظيفية
FunctionGethttpimg (URL)
onerrorresumenext
DIMXMLHTTP
setXMLHTTP = server.createObject ("msxml2.xmlhttp")
XMLHTTP.Open "GET" ، url ، false
xmlhttp.send ()
IFXMLHTTP.STATUS <> 200 THENEXITFunction
gethttpimg = xmlhttp.responseBody
setXMLHTTP = لا شيء
iferr.number <> 0thenerr.clear
الوظيفية
FunctionSave2Local (من ، tofile)
Dimgeturl ، objstream ، imgs
geturl = trim (من)
IMGS = gethttpimg (geturl)
setObjStream = server.createBject ("Adodb.stream")
objstream.type = 1
objstream.Open
objstream.writeimgs
objstream.savetofiletofile ، 2