用VBS实现的发送带Cookie的HTTP请求的代码
 为了方便测试,先写一个回显Cookie的简单的PHP程序: 
然后分别用ServerXMLHTTP和XMLHTTP测试:
用Msxml2.XMLHTTP什么都没有返回。
用Msxml2.ServerXMLHTTP返回
user => demon
passwd => 123456
以后碰到需要Cookie的网页就不用愁了。
原文: http://demon.tw/programming/vbs-http-cookie.html
   代码如下:
<?php foreach($_COOKIE as $key => $value) echo "$key => $value\r\n"; ?>
然后分别用ServerXMLHTTP和XMLHTTP测试:
代码如下:
Dim http 
Set http = CreateObject("Msxml2.XMLHTTP") 
http.open "GET", "http://demon.tw/test/cookie.php", False 
http.SetRequestHeader "Cookie", "user=demon; passwd=123456" 
http.send 
WScript.Echo http.responseText 用Msxml2.XMLHTTP什么都没有返回。
代码如下:
Dim http 
Set http = CreateObject("Msxml2.ServerXMLHTTP") 
http.open "GET", "http://demon.tw/test/cookie.php", False 
http.SetRequestHeader "Cookie", "user=demon; passwd=123456" 
http.send 
WScript.Echo http.responseText 用Msxml2.ServerXMLHTTP返回
user => demon
passwd => 123456
以后碰到需要Cookie的网页就不用愁了。
原文: http://demon.tw/programming/vbs-http-cookie.html
相关推荐
  zhaolisha    2020-05-26  
   houmenghu    2020-11-17  
   kentrl    2020-11-10  
   jincheng    2020-09-01  
   Blueberry    2020-08-15  
   xclxcl    2020-08-03  
   zmzmmf    2020-08-03  
   阳光之吻    2020-08-03  
   PkJY    2020-07-08  
   hzyuhz    2020-07-04  
   89407707    2020-06-27  
   服务器端攻城师    2020-06-26  
   阳光岛主    2020-06-25  
   笨重的蜗牛    2020-06-20  
   xuanwenchao    2020-06-14  
   Lophole    2020-06-13  
   明瞳    2020-06-12