msxml2.xmlhttp 和 adodb.stream
复制代码代码如下 :
<! doctypehtmlpublic "-// w3c // dtdxhtml1.0transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<htmlxmlns = "http://www.w3.org/1999/xhtml">
<헤드>
<title> asp p </title>
<metahttp-equiv = "content-type"content = "text/html; charset = utf-8"/>
</head>
<body>
<%
functiongethttpimg (url)
onerrorresumenext
dimhttp
sethttp = server.createobject ( "msxml2.xmlhttp")
http.open "get", url, false
http.send ()
ifhttp.readystate <> 4thenexitfunction
gethttpimg = http.responsebody
sethttp = 아무것도
iferr.number <> 0thenerr.clear
최종 기능 장애
subsave2local (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
objstream.close ()
setobjstream = 아무것도
'Response.write ( "Theimghassaved!")
Endsub
Callave2local ( "// www.vevb.com/logos.gif" theerver.mappath("google.gif")))
%>
</body>
</html>