20-03-2011, 09:23 AM
تم ايجاد الحل
كود :
procedure TDown.btn3Click(Sender: TObject);
var i,j,max,c:Integer;
begin
max :=0;c:=0;
down.Caption:='Download ..';
for j :=0 to lv1.Items.Count-1 do
if lv1.Items[j].Checked=True then
max:=max+1;
//-----------------------
pb1.Max:=max;
//pb1.Max:=lv1.Items.Count;
for i:=0 to lv1.Items.Count-1 do begin
if lv1.Items[i].Checked=True then
begin
mmo2.Lines.Add('> Downlad ..'+ lv1.Items[i].SubItems.Text+' ...');
Sleep(100);
//DownloadFile(lv1.Items[i].SubItems.Text , 'C:\work');
//-------
c:=c+1;
iehttp1.ExecuteURL(lv1.Items[i].SubItems.Text);
iehttp1.result_ms.SaveToFile('c:\'+inttostr(i)+'.zip');
mmo2.Lines.Add('> Downlad : '+lv1.Items[i].SubItems.Text+'..ok');
down.Caption:='Download ..'+inttostr(c)+'/'+inttostr(max);
end;
