type TForm1 = class(TForm) Button1: TButton; IdHTTP1: TIdHTTP; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); var s:TStringList; MStream:TMemoryStream; i:integer;
begin s:=TStringList.Create; s.Add('http://www.3464.com/pic/bimg/albums/photos/1/0/1/101705/1139753842.jpg'); s.Add('http://www.delphitop.com/pic/bimg/albums/photos/1/0/1/101705/1139753793.jpg'); s.Add('http://www.j7j8.com/pic/bimg/albums/photos/1/0/1/101705/1139753782.jpg'); for i:=0 to s.Count-1 do begin MStream:=TMemoryStream.Create; IdHttp1.Get(s[i],MStream); MStream.SaveToFile('c:\'+IntToStr(i)+'.jpg'); MStream.Free; end; ShowMessage('下载完毕'); s.Free; end; end.