<%
'이름 : ASP 일반 컬렉션 기능 중복 버전, 고품질 버전 자체를 수정하려는 사람들
'저자 : Liu Yongfa
'날짜 : 2007-6-23
functiongethttppage (경로)
t = getbody (경로)
gethttppage = bytestobstr (t, "gb2312")
최종 기능 장애
functiongetBody (URL)
onerrorresumenext
setxmlhttp = createobject ( "microsoft.xmlhttp")
withxmlhttp
. "get", url, false, "", ",", ""
.보내다
.WaitForResponse1000
getbody = .ResponseBody
끝
setxmlhttp = 아무것도 없습니다
최종 기능 장애
functionbyTestObstr (body, 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 = 아무것도
최종 기능 장애
functiongethttpimg (url)
onerrorresumenext
dimxmlhttp
setxmlhttp = server.createobject ( "msxml2.xmlhttp")
xmlhttp.open "get", url, false
xmlhttp.send ()
ifxmlhttp.status <> 200thenexitfunction
gethttpimg = xmlhttp.responsebody
setxmlhttp = 아무것도 없습니다
iferr.number <> 0thenerr.clear
최종 기능 장애
functionsave2local (from, tofile)
dimgeturl, objstream, imgs
geturl = trim (from)
imgs = gethttpimg (geturl)
setobjstream = server.createobject ( "adodb.stream")
objstream.type = 1
objstream.open
objstream.writeimgs
objstream.savetofiletofile, 2