her er koden
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,xptheme,urlmon, StdCtrls, ComCtrls, Gauges, IdAntiFreezeBase,
IdAntiFreeze, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP;
type
TForm1 = class(TForm)
RichEdit1: TRichEdit;
Button1: TButton;
Label1: TLabel;
IdHTTP1: TIdHTTP;
IdAntiFreeze1: TIdAntiFreeze;
ProgressBar1: TProgressBar;
procedure Button1Click(Sender: TObject);
procedure IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
procedure IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
FStrm : TFilestream;
begin
FStrm := TFilestream.Create('c:\\downloaded.txt', fmCreate);
Try
IdHTTP1.Get('http://www.side.dk/fil.txt', FStrm);
Finally
Fstrm.Free;
end;
end;
procedure TForm1.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
progressbar1.Max := AWorkCountMax;
end;
procedure TForm1.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
progressbar1.Position := AWorkCount;
end;
end.
fejlen kommer når jeg trykker på knappen
[Redigeret d. 22/06-03 17:01:00 af BananJoe]urlen til filen er
http://www.burn-it.dk/123.abc[Redigeret d. 22/06-03 17:15:09 af BananJoe]