Y yellowfish Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-06 #1 我用ICS的httpcli组件,在httpcli.cookie里填入了相应内容,可是在httpcli.get后发现仍然没有下载到使用cookie后的内容。 哪位大虾知道可能是什么原因?
Y yellowfish Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-06 #2 我用ICS的httpcli组件,在httpcli.cookie里填入了相应内容,可是在httpcli.get后发现仍然没有下载到使用cookie后的内容。 哪位大虾知道可能是什么原因?
9 9278707 Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-06 #3 ICS的控件好象有问题,我原来也用他后来又换成idhttp了,这是我写的一个文件下载的函数,希望对你有所帮助 function TMainPage.DownLoadSeed(Refer,Source,Dest: string): string; var _Source: string; RcvdStream: TFileStream; begin _Source := UpperCase(Source); Result := SeedDownSuccess; try try with HttpCli.Request do begin if Pos('.TORRENT',_Source) = 0 then begin Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*'; Referer := Refer; AcceptLanguage := 'zh-cn'; AcceptEncoding := 'gzip, deflate'; Username := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)'; Connection := 'Keep-Alive'; ExtraHeaders.Clear; ExtraHeaders.Add('Cookie: PHPSESSID=b88092023318402023b22ac0452dbc41; nalog_check=0; nalogindex=1129777030; nalogindex_hit=0'); ExtraHeaders.Add('Cookie: enable=1'); ExtraHeaders.Add('Cookie: enable=1; isCookie=1; post_sep=1133399250'); end; RcvdStream := TFileStream.Create(Dest, fmCreate); HttpCli.Get(Source, RcvdStream); end; Except on E: Exception do Result := E.Message; end; finally RcvdStream.Free; RcvdStream := nil; end; end;
ICS的控件好象有问题,我原来也用他后来又换成idhttp了,这是我写的一个文件下载的函数,希望对你有所帮助 function TMainPage.DownLoadSeed(Refer,Source,Dest: string): string; var _Source: string; RcvdStream: TFileStream; begin _Source := UpperCase(Source); Result := SeedDownSuccess; try try with HttpCli.Request do begin if Pos('.TORRENT',_Source) = 0 then begin Accept := 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*'; Referer := Refer; AcceptLanguage := 'zh-cn'; AcceptEncoding := 'gzip, deflate'; Username := 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322)'; Connection := 'Keep-Alive'; ExtraHeaders.Clear; ExtraHeaders.Add('Cookie: PHPSESSID=b88092023318402023b22ac0452dbc41; nalog_check=0; nalogindex=1129777030; nalogindex_hit=0'); ExtraHeaders.Add('Cookie: enable=1'); ExtraHeaders.Add('Cookie: enable=1; isCookie=1; post_sep=1133399250'); end; RcvdStream := TFileStream.Create(Dest, fmCreate); HttpCli.Get(Source, RcvdStream); end; Except on E: Exception do Result := E.Message; end; finally RcvdStream.Free; RcvdStream := nil; end; end;
Y yellowfish Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-06 #4 我是直接将系统Cookies目录下文件的内容填到httpcli里,这样可以吗?
9 9278707 Unregistered / Unconfirmed GUEST, unregistred user! 2005-12-07 #5 我看了一下系统cookies目录下的内容 sina 2005-08-22 16:56:39,1,0,1 64.adsina.allyes.com/ 1024 3176086912 29730953 254339904 29730551 * cache-sina 1609,2005:08:22:16:56:39:4:1:1,0#`64,2005:08:22:16:56:39,0#`2005-08-22,0,1611,64,150689,1671#`0,0,1611,64,150689,1671`2005-08-22 16:56:39`1 64.adsina.allyes.com/ 1024 3176086912 29730953 254499904 29730551 * 这个应该不是idhttp所需的cookie,不过根据这个文件应该能够算出 我是通过一个ie抓包工具抓到的这个cookie值。
我看了一下系统cookies目录下的内容 sina 2005-08-22 16:56:39,1,0,1 64.adsina.allyes.com/ 1024 3176086912 29730953 254339904 29730551 * cache-sina 1609,2005:08:22:16:56:39:4:1:1,0#`64,2005:08:22:16:56:39,0#`2005-08-22,0,1611,64,150689,1671#`0,0,1611,64,150689,1671`2005-08-22 16:56:39`1 64.adsina.allyes.com/ 1024 3176086912 29730953 254499904 29730551 * 这个应该不是idhttp所需的cookie,不过根据这个文件应该能够算出 我是通过一个ie抓包工具抓到的这个cookie值。