如何显示TIdHttp的上传或者下载进度

用indy上传下载文件时,可以先在IdHTTP1WorkBegin中获得总大小,然后在IdHTTP1Work中实时得到当前的传输量,一遍算出整体的传输进度。

procedure TForm1.IdHTTP1WorkBegin(Sender:TObject; AWorkMode:TWorkMode;
  const AWorkCountMax:Integer);
begin
  ShowMessage(IntToStr(AWorkCountMax));
end;

procedure TForm1.IdHTTP1Work(Sender:TObject; AWorkMode:TWorkMode;
  const AWorkCount:Integer);
begin
  Caption := IntToStr(AWorkCount);
end;

Posted in 未分类 at 02月 28th, 2009. Trackback URI: trackback
Tags: , , ,

No Responses to “如何显示TIdHttp的上传或者下载进度”

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
请输入图片中的字符以验证你并非垃圾机器人. 点击图片收听验证码的语音版.
点击这里收听此验证码的语音版本