procedure TForm1.DownLoadFile(URL:String;FileName:String;Resume:Boolean);
var
tStream : TFileStream ;
begin
if FileExists(FileName) then
tStream := TFileStream.Create(FileName,fmOpenReadWrite)
else
tStream := TFileStream.Create(FileName,fmCreate); if Resume then //断点续传
begin
IdHttp1.Request.ContentRangeStart := tStream.Size - 1 ;
tStream.Position := tStream.Size - 1 ;
IdHttp1.Head(URL);
IdHttp1.Request.ContentRangeEnd := IdHttp1.Response.ContentLength ;
end
else
IdHttp1.Request.ContentRangeStart := 0 ; try
IdHttp1.Get(URL,tStream);
finally
tStream.Free ;
end;end;procedure TForm1.Button2Click(Sender: TObject);
begin
DownLoadFile('http://10.136.72.121:2000/updateimage/renderingsimages/0000000001/','O1016448851703512.jpg',false);
end;
不知道还需要设置什么,我现在的问题是下了2K就没反应了????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货