D7+Indy 9.0代码如下:
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls; type
TForm1 = class(TForm)
idhtp1: TIdHTTP;
btn1: TButton;
mmo1: TMemo;
Edit1: TEdit;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject);
var
s :string;
begin
s:=idhtp1.Get(edit1.text);
mmo1.Text :=s;
end; end. 访问如http://www.0591qs.cn/div/article.php?type=blog&itemid=1
http://www.winu.cn/viewthread.php?tid=6295
发现很多像这样的PHP网页根本没有完全读入,但是也会被GET认为已经读完了,所以得到的代码就是不完整的,偶重试了20次读取,会有1,2次可以完全读入,到底是什么原因啊,偶从没看过有人有这种原因啊!
idhttp get()判断是否完全读完的根据是什么啊?
一般读入不完整时,读取的速度都非常快,2,3秒就完成了,而能完整读入的,一般都要3秒以上,而且现在只发现在PHP类的网页上比较多,其它的暂时没有发现
unit Unit1; interface uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, StdCtrls; type
TForm1 = class(TForm)
idhtp1: TIdHTTP;
btn1: TButton;
mmo1: TMemo;
Edit1: TEdit;
procedure btn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.btn1Click(Sender: TObject);
var
s :string;
begin
s:=idhtp1.Get(edit1.text);
mmo1.Text :=s;
end; end. 访问如http://www.0591qs.cn/div/article.php?type=blog&itemid=1
http://www.winu.cn/viewthread.php?tid=6295
发现很多像这样的PHP网页根本没有完全读入,但是也会被GET认为已经读完了,所以得到的代码就是不完整的,偶重试了20次读取,会有1,2次可以完全读入,到底是什么原因啊,偶从没看过有人有这种原因啊!
idhttp get()判断是否完全读完的根据是什么啊?
一般读入不完整时,读取的速度都非常快,2,3秒就完成了,而能完整读入的,一般都要3秒以上,而且现在只发现在PHP类的网页上比较多,其它的暂时没有发现
解决方案 »
- 有关动态连接库的问题
- 线形规划问题,高手请进(分不够可再加)
- 全局变量怎么搞?
- 用什么方法可以实现,在有调试器的情况下,出现异常时控制权不返回到调试器。
- 大家都来讨论一下Delphi程序员是学Java 还是 C#(散分)
- TCustomForm与TForm的区别
- DELPHI的下载问题,高手请速进
- 在2000或NT下的监控方法
- 如果数据过多,用socket的sendtext会不会出现丢失、错误现象?
- Kingron,非常感谢你关于typecast的答复,特献上100分!
- D7+Odac+Stringgrid+Oracle9.2,如何实现对oracle中表的修改和保存?
- 我的 Delphi6 加上VSS 6 由于最近我们公司换域 所以在新域里面不能正常使用
memo1.Text:=str;
showmessage(inttostr(length(str)));
showmessage(inttostr(length(memo1.Text)));show出来的长度是不一样的实际的str里面已经是完整的内容了,不信你可以用Visual Sniffer拦截tcp数据包,每次get都返回了完整的数据也可以var
aaa:Tmemorystream;
begin
aaa:=Tmemorystream.Create;
idhttp1.get('http://www.0591qs.cn/div/article.php?type=blog&itemid=1',aaa);aaa.SaveToFile('d:\aaa.txt');
showmessage(inttostr(aaa.Size));
aaa.free;
end;d:\aaa.txt 里每次都能保存下完整的内容