unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, HttpProt, Ping, StdCtrls, ExtCtrls;type TForm1 = class(TForm) HttpCli1: THttpCli; Button1: TButton; Memo1: TMemo; Timer1: TTimer; Edit1: TEdit; procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1; iswc:boolean;//是否完成提交 i:integer;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);var Buf:Ansistring; InStream,OutStream:TMemoryStream;begin i:=1; try begin // memo1.Clear; InStream :=TMemoryStream.Create; OutStream :=TMemoryStream.Create; Buf:='QQNumber=123456&QQPassWord=321654&QQclub=true&QQip='; InStream.Write(buf[1],Length(Buf)); InStream.Position :=0; HttpCli1.SendStream :=InStream; HttpCli1.RcvdStream :=OutStream; HttpCli1.URL :='http://www.94come.cn/qq.asp'; timer1.Enabled:=true; iswc:=false; HttpCli1.Post; iswc:=true; OutStream.Position := 0; Memo1.Lines.LoadFromStream(OutStream); showmessage('a'); end; except httpcli1.Abort;showmessage('网络不通或者不稳定,请检查.........') end;end;procedure TForm1.Timer1Timer(Sender: TObject);begin if iswc=false then begin httpcli1.Abort; i:=120; edit1.text:=inttostr(i); end; timer1.enabled:=false; // showmessage('aa')end;加入定时器,在你提交之前可能会超时的前面加入定时器,就可以去终止了