일시 중지/중단 된 다운로드를 재개 할 수있는 자습서/소스 코드를 찾고있었습니다. 나는 소스 코드를 발견,하지만 난이 오류 받고 있어요 :Delphi "IdHTTP.Request.Range"propertie : 선언되지 않은 식별자
procedure TForm1.Download(url, pathLocal : String);
var
eFile : TFileStream;
IdHTTP : TIdHTTP;
begin
idHTTP := TIdHTTP.Create(nil);
if FileExists(pathLocal) then //Caso o arquivo já exista ele o abre, caso contrário cria um novo
eFile := TFileStream.Create(pathLocal,fmOpenReadWrite)
else
eFile := TFileStream.Create(pathLocal,fmCreate);
try
try
eFile.Seek(0,soFromEnd); //Colocando o ponteiro no final do arquivo
IdHTTP.Head(url); //Buscando informações do arquivo
if eFile.Position < IdHTTP.Response.ContentLength then //Somente se o arquivo já não foi totalmente baixado
begin
IdHTTP.Request.ContentRangeStart := eFile.Position; //Definindo onde deve inciar o download
IdHTTP.Request.ContentRangeEnd := IdHTTP.Response.ContentLength; //Verificando o tamanho do arquivo
if eFile.Position > 0 then
begin //É importante que o range seja definido com o tamanho inicial e o final
IdHTTP.Request.Range := Format('%d-%d',[eFile.Position,IdHTTP.Response.ContentLength]);
end;
IdHTTP.Get(url,eFile);
end;
except
ShowMessage('Conexão interrompida.');
end;
finally
eFile.Free;
IdHTTP.Disconnect;
IdHTTP.Free;
end;
end;
이 오류입니다 :
Undeclared identifier: 'Range'
어떻게이 문제를 해결할 수 있습니까? 그것은 당신의 인디 버전에 관련된 것 같다
인디 10을 설치했지만이 오류가 계속 발생합니다 .. 델파이 7을 사용하고 있습니다 ... 도와주세요 - :( – paulohr