这段代码如何使用线程,这段代码让程序采取快速锁定线程会更好?
如何重复线程直到 i = ListBox1.Items.Count -1
var
lURL : String;
lResponse : TStringStream;
begin
lResponse := TStringStream.Create('');
TestText := Form1.ListBox1.Items[i];
I := i +1;
Test1 := Copy(TestText, 0, 16);
Test2 := Copy(TestText, 18, 3);
Test3 := Copy(TestText, 22, 2);
Test4 := Copy(TestText, 27, 2);
try
lURL := 'http://www.test.net/test/test.php' +
'?n=' + Test1 +
'&m=' + Test2 +
'&a=' + Test3 +
'&cv=' + Test4;
idHttp1.Get(lURL, lResponse);
lResponse.Position := 0;
RichEdit1.Lines.LoadFromStream(lResponse);
finally
IdHTTP1.Free;
lResponse.Free();
if Pos('Bazinga',RichEdit1.Text)> 0 then
label1.Caption := 'True';
end;
end;