zoukankan      html  css  js  c++  java
  • asp调用wcf服务、webservice

    '//1、输入url目标网页地址,返回值getHTTPPage是目标网页的html代码
    
         Function getHTTPPage(url)
    
              url=cstr(url)
    
              dim Http
    
              set Http=server.createobject("MSXML2.ServerXMLHTTP")
    
             ' Response.write url
    
             ' Response.end
    
              Call Http.setTimeouts(90000,90000,90000,90000)
    
              Http.open "GET",url,false
    
              Http.send()
    
              if Http.readystate<>4 then 
    
               exit function
    
              end if
    
      
    
              getHTTPPage=bytesToBSTR(Http.responseBody,"utf-8")
    
              set http=nothing
    
              if err.number<>0 then err.Clear 
    
             End Function
    
             '//2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
    
             Function BytesToBstr(body,Cset)
    
              dim objstream
    
              set objstream = Server.CreateObject("adodb.stream")
    
              objstream.Type = 1
    
              objstream.Mode =3
    
              objstream.Open
    
              objstream.Position = 0
    
              objstream.Type = 2
    
              objstream.Charset = Cset
    
              BytesToBstr = objstream.ReadText 
    
              objstream.Close
    
              set objstream = nothing
    
             End Function 
  • 相关阅读:
    今日大跌!
    web servers
    ASP.NET2.0缓存机制
    赚钱的总是史玉柱?
    asp.net速查手册
    为伊消得人憔悴,我的2007成就难有,内心彷徨
    success
    失守4600点
    Linux下chkconfig命令详解
    FTP批处理下载木马
  • 原文地址:https://www.cnblogs.com/yangbingqi/p/2127673.html
Copyright © 2011-2022 走看看