zoukankan      html  css  js  c++  java
  • ASP采集图片的小程序,ASP采集图片

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </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

    Function 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 
    End Function

    call Save2Local("")) 
    response.Write("ok")
    %> 
    </body>
    </html>

  • 相关阅读:
    动态规划精讲(一)LC最长公共子序列
    0-1背包
    折线分割平面
    母牛的故事
    数塔
    70. 爬楼梯
    文件修改的两种方式
    文件处理练习
    文件处理
    购物车理解
  • 原文地址:https://www.cnblogs.com/subendong/p/2864871.html
Copyright © 2011-2022 走看看