源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

利用MSXML2.XmlHttp和Adodb.Stream采集图片

  • 时间:2021-09-29 17:49 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:利用MSXML2.XmlHttp和Adodb.Stream采集图片
利用MSXML2.XmlHttp和Adodb.Stream
[u]复制代码[/u] 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml">  <head>  <title>ASP采集图片测试</title>  <meta http-equiv="content-type" content="text/html; charset=utf-8" />  </head>  <body>  <%   Function Gethttpimg(Url)     On Error Resume Next     Dim Http     Set Http=Server.Createobject("MSXML2.XmlHttp")     Http.Open "Get",Url,False     Http.Send()     If Http.Readystate<>4 Then Exit Function     Gethttpimg=Http.Responsebody     Set Http=Nothing     If Err.Number<>0 Then Err.Clear  End Function  Sub Save2Local(From,Tofile)     Dim Geturl,Objstream,Imgs     Geturl=Trim(From)     Imgs=Gethttpimg(Geturl)     Set Objstream = Server.Createobject("Adodb.Stream")     Objstream.Type =1     Objstream.Open     Objstream.Write Imgs     Objstream.Savetofile Tofile,2     Objstream.Close()    Set Objstream=Nothing     'Response.Write("The Img has saved!")  End Sub  Call Save2Local("http://www.1sucai.cn/logos.gif",Server.MapPath("google.gif"))   %>   </body>  </html>  
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部