witam mam
procedure TForm1.HTTPGet1DoneFile(Sender: TObject; FileName: String;
FileSize: Integer);
var
INI : TINIFile;
updtVersion : string;
cyfra1 : integer;
cyfra2 : integer;
updtCyfr1 : integer;
updtCyfr2 : integer;
begin
INI := TINIFile.Create(HTTPGet1.FileName);
try
updtVersion := INI.ReadString('update','version',''); //odcytanie wersji z pliku ini
//nie śmiejcie sie z tego sposobu. To tylko przykład :)
cyfra1 := StrToInt(wersja[1]);
cyfra2 := StrToInt(wersja[3]);
updtCyfr1 := StrToInt(updtVersion[1]);
updtCyfr2 := StrToInt(updtVersion[3]);
if (cyfra1 < updtCyfr1) or (cyfra2 < updtCyfr2) then //sprawdzenie, czy jest nowa wersja
begin
{wyświetlenie zapytania. Jeśli użytkownik wybierze Tak, rozpoczyna się pobieranie programu }
if Application.MessageBox('Czy chcesz pobrać nową wersję programu?','Informacja',MB_YesNo) =
ID_NO then
exit
else
begin
HTTPGet2.URL := INI.ReadString('update','url','');
if SaveDialog1.Execute then // tu użytkownik wybierze, gdzie zapisać program
HTTPGet2.FileName := SaveDialog1.FileName;
HTTPGet2.GetFile; //pobieranie pliku
end;
end
else
finally
INI.Free;
DeleteFile(HTTPGet1.FileName); //usunięcie pliku ini
end;
end;
Gdy włacze program po kliknieciu wywala mi błąd w
updtCyfr1 := StrToInt(updtVersion[1]);
updtCyfr2 := StrToInt(updtVersion[3]);
Wie ktoś czemu?