delphi用idhttp怎么实现下载文件的简单功能?(不用多线程,写一个按钮实例就行,学习一下)
展开全部
procedure TForm1.Button1Click(Sender: TObject);
var mystream1 :TMemoryStream;
begin
mystream1 :=TMemoryStream.Create;
IdHTTP1.Get('http://www.pconline.com.cn/pcedu/photo/0508/pic/050831girl18.jpg'誉信,mystream1);
mystream1.SaveToFile('c:\050831girl18.jpg'庆滑轮让尺);
end;
var mystream1 :TMemoryStream;
begin
mystream1 :=TMemoryStream.Create;
IdHTTP1.Get('http://www.pconline.com.cn/pcedu/photo/0508/pic/050831girl18.jpg'誉信,mystream1);
mystream1.SaveToFile('c:\050831girl18.jpg'庆滑轮让尺);
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询