预览模式: 普通 | 列表

Asp利用winhttp获取重定向网页源代码

ASP/Visual Basic代码
  1. Dim oHttp : Set oHttp=CreateObject("WinHttp.WinHttpRequest.5.1")   
  2. oHttp.Option(6)=1'是否抓取重定向,0为否  
  3. oHttp.SetTimeouts 5000,5000,30000,5000   
  4. oHttp.Open "GET",Url,False   
  5. oHttp.Send  
  6. 'response.Write(oHttp.Status)  
  7. Response.BinaryWrite oHttp.ResponseBody  

Tags: asp

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2801

Asp实用xmlhttp读取网页header内容

ASP/Visual Basic代码
  1. dim Http  
  2. set Http=server.createobject("Microsoft.XMLHTTP")  
  3. Http.open "GET",url,false  
  4. Http.send()  
  5. if Http.readystate<>4 then   
  6. exit function  
  7. end if  
  8. header=Http.getAllResponseHeaders  
  9. set http=nothing

Tags: asp

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2863

 广告位

↑返回顶部↑