用HttpGet就可以实现了
//不能有缓存
UseCache属性设为False
//有下载进度,参考下面的程序
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, HTTPGet, StdCtrls;
type
TForm1 = class(TForm)
HTTPGet1: THTTPGet;
ProgressBar1: TProgressBar;
Button1: TButton;
procedure HTTPGet1Progress(Sender: TObject; TotalSize,
Readed: Integer);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ProgressBar1.Max := 100;
ProgressBar1.Min := 0;
ProgressBar1.Position := 0;
HTTPGet1.URL := 'http://www.delphibbs.com/delphibbs/listq.asp';
HTTPGet1.FileName := 'C:/listq.asp';
HTTPGet1.GetFile;
end;
procedure TForm1.HTTPGet1Progress(Sender: TObject; TotalSize,
Readed: Integer);
begin
ProgressBar1.Position := (100 * Readed) div TotalSize;
end;
end.