L
ljdzxx
Unregistered / Unconfirmed
GUEST, unregistred user!
我用IE直接访问资源http://wow.girlstar.cn/res.php?id=11
时,可监控(用监控工具HttpDetect,可到http://www.effetech.com
下载)到HTTP请求头为如下:
==============================================================
GET /res.php?id=11 HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: wow.girlstar.cn
Connection: Keep-Alive
Cookie: disad=1; AJSTAT_ok_times=2
注意上面带了Cookie信息,现在我改用IdHttp下载,代码如下:
FileStream1:= TFileStream.Create('C:/abc.rar',fmCreate);
try
IdHTTP1.Get('http://wow.girlstar.cn/res.php?id=11',FileStream1);
finally
FileStream1.Free;
end;
监控到的Http请求头为如下:
===========================================================================
GET /res.php?id=11 HTTP/1.1
Content-Type: text/html
Host: wow.girlstar.cn
Accept: text/html, */*
User-Agent: Mozilla/3.0 (compatible; Indy Library)
为何却没有出现Cookie信息啊?IdHttp我绑定了IdCookieManager的,谁知道怎么像IE一样在发送Http请求的时候就自动把Cookies带进去么?别告诉我说反正资源可以下载就不用理会那个!我现在做的一个防防盗链程序就是需要实现这个.
时,可监控(用监控工具HttpDetect,可到http://www.effetech.com
下载)到HTTP请求头为如下:
==============================================================
GET /res.php?id=11 HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: wow.girlstar.cn
Connection: Keep-Alive
Cookie: disad=1; AJSTAT_ok_times=2
注意上面带了Cookie信息,现在我改用IdHttp下载,代码如下:
FileStream1:= TFileStream.Create('C:/abc.rar',fmCreate);
try
IdHTTP1.Get('http://wow.girlstar.cn/res.php?id=11',FileStream1);
finally
FileStream1.Free;
end;
监控到的Http请求头为如下:
===========================================================================
GET /res.php?id=11 HTTP/1.1
Content-Type: text/html
Host: wow.girlstar.cn
Accept: text/html, */*
User-Agent: Mozilla/3.0 (compatible; Indy Library)
为何却没有出现Cookie信息啊?IdHttp我绑定了IdCookieManager的,谁知道怎么像IE一样在发送Http请求的时候就自动把Cookies带进去么?别告诉我说反正资源可以下载就不用理会那个!我现在做的一个防防盗链程序就是需要实现这个.