Guten Abend,
vom Prinzip könnte es in etwa so laufen:
(Habe es nicht getestet)
Delphi-Quellcode:
type
THttpRequestThread = class(TTHread)
private
URLList: TStringList;
idHttp : TidHttp;
procedure enableTimer;
protected
procedure execute;override;
public
constructor create(AURLList:TStringList);
end;
implementation
constructor THttpRequestThread.create(AURLList:TStringList);
begin
URLList :=TStringList.create;
URLList.assign(AURLList);
idHttp := TidHttp.create;
inherited create(false);
end;
procedure THttpRequestThread.enableTimer;
begin
TForm1.Timer1.enabled := true;
end;
procedure THttpRequestThread.execute;
var
i: Integer;
s: String;
begin
i:=0;
while (not terminated) and (i < URLList.count -1) do
begin
s:=idHttp.get(URLList[i];
// mache etwas mit s
inc(i);
end;
URLList.free;
idHttp.free;
synchronize(enableTimer);
end;
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var
httpRequestThread: THttpRequestThread;
begin
(sender as TTimer).Enabled:=false;
httpRequestThread := THttpRequestThread.create(URLList);
end;
Grüße
Klaus