thank you Luckie
Here is my Thread Code :
Could you Fix it for me please . many thanks
Delphi-Quellcode:
procedure TFileDownThread.Execute;
var
FStream: TFileStream;
i:Integer;
begin
For i:=0
to FUrl.Count-1
do
begin
IdHTTP := TIdHTTP.Create(
nil);
try
IdHTTP.Request.UserAgent := '
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)';
IdHTTP.OnWorkBegin := FWorkBeginEvent;
IdHTTP.OnWork := FWorkEvent;
IdHTTP.OnWorkEnd := FWorkEndevent;
IdHTTP.HandleRedirects:=False;
// IdHTTP.RedirectMaximum := 15;
// Idhttp.OnRedirect:=OnRedirect;
IdHTTP.Head(
URL[i]);
BytesInsgesamt := IdHTTP.Response.ContentLength;
FStream:= TFileStream.Create(ExtractUrlFileName(
URL[i]), fmCreate);
IdHTTP.Get(
URL[i], FStream);
finally
IdHTTP.Free;
FStream.Free;
end;
// Synchronize(ShowCode);
end;
end;