if IdFTP1.Connected then IdFTP1.Disconnect; idftp1.Connect; BytesToTransfer := IdFTP1.Size(pri_ExeftpPath); idftp1.Get(pri_ExeftpPath,ExtractFilePath(application.ExeName)+'emergency.exe',true); idftp1.Disconnect;//----------------------------------procedure TFormUpdate.IdFTP1WorkBegin(ASender: TObject; AWorkMode: TWorkMode; AWorkCountMax: Int64);begin STime := Now; if AWorkCountMax > 0 then ProgressBar1.Max := AWorkCountMax else ProgressBar1.Max := BytesToTransfer;end;/----------------------------------