亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

用VBS實現(xiàn)的發(fā)送帶Cookie的HTTP請求的代碼

 更新時間:2013年01月14日 00:51:46   作者:  
在昨天的《使用正確版本的XMLHTTP》中賣了個關(guān)子,ServerXMLHTTP的功能比XMLHTTP強大,你現(xiàn)在大概已經(jīng)猜到了吧。沒錯,用ServerXMLHTTP可以在HTTP請求頭中加入Cookie,而XMLHTTP不可以
為了方便測試,先寫一個回顯Cookie的簡單的PHP程序:
復(fù)制代碼 代碼如下:

<?php
foreach($_COOKIE as $key => $value)
echo "$key => $value\r\n";
?>

然后分別用ServerXMLHTTP和XMLHTTP測試:
復(fù)制代碼 代碼如下:

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什么都沒有返回。
復(fù)制代碼 代碼如下:

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的網(wǎng)頁就不用愁了。
原文: http://demon.tw/programming/vbs-http-cookie.html

相關(guān)文章

最新評論