我为这个应用程序工作了几天。表格冻结,直到整个事务。如何使用胎面?
procedure TForm1.ListBox1Click(Sender: TObject);
var
I: Integer;
S: String;
begin
I := Listbox1.ItemIndex;
if I <> -1 then
begin
S := Listbox1.Items[I];
IdHTTP1.ProxyParams.ProxyServer := Fetch(S, ':');
IdHTTP1.ProxyParams.ProxyPort := StrToInt(S);
try
IdHTTP1.ReadTimeout:=strtoint(form1.ComboBox1.Text); // ZMAAN AŞIMI
IdHTTP1.Get(Edit4.Text); // POST GET
Memo1.Lines.Add(Format('Sıra %d %s', [I, 'Bağlandı.']));
except
Memo1.Lines.Add(Format('Sıra %d %s', [I, 'Bağlanamadı.']));
IdHTTP1.Disconnect; // ÖLDÜR.
end;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Timer1.Enabled := False;
try
ListBox1Click(nil);
if ListBox1.ItemIndex < ListBox1.Items.Count - 1 then
ListBox1.ItemIndex := ListBox1.ItemIndex + 1
else
ListBox1.ItemIndex := -1;
finally
Timer1.Enabled := True;
end;
if ListBox1.ItemIndex = -1 then
Timer1.Enabled:=false;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Timer1.Enabled := true;
end;
先感谢您。