odczyt informacji z serwera do memo

0

zlozylem taki kod

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, HTTPGet, StdCtrls,inifiles;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    HTTPGet1: THTTPGet;
    procedure Button1Click(Sender: TObject);
    procedure HTTPGet1DoneFile(Sender: TObject; FileName: String;
      FileSize: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
 HTTPGet1.URL := 'http://www.kom-box.pl/version.ini';  //lokalizacja pliku z informacją
 HTTPGet1.FileName := ExtractFilePath(Application.ExeName) + 'version.ini'; 
 HTTPGet1.GetFile;  //pobranie pliku ini
 Memo1.Lines.Add('Pobieranie informacji...');
end;

procedure TForm1.HTTPGet1DoneFile(Sender: TObject; FileName: String;
  FileSize: Integer);
var
 INI : TINIFile;
 updtVersion : string;
 cyfra1 : integer;
 cyfra2 : integer;
 updtCyfr1 : integer;
 updtCyfr2 : integer;
begin
 Memo1.Lines.Add('Sprawdzanie, czy jest nowa wersja');
 INI := TINIFile.Create(HTTPGet1.FileName);
 try
   updtVersion := INI.ReadString('update','version','');  //odcytanie wersji z pliku ini
 begin
 memo1.lines:=updtVersion;
 finally
   INI.Free;
   DeleteFile(HTTPGet1.FileName); //usunięcie pliku ini
 end;

end;

end.

wywala mi blad w lini

 memo1.lines:=updtVersion;

[Error] Unit1.pas(53): Incompatible types: 'TStrings' and 'String'

nie kumam co jest zle ? Wszystko sprawdzam po kilka razy i nie widze bledu

0

No, różne typu zmiennych, powinno być memo1.Lines.Text := updtVersion

0

memo text za kazdym razem przed dodaniem tekstu czysci memo, wiec jak chcesz dodac np.

 memo1.Lines.Text := updtVersion;
 memo1.Lines.Text := updtVersion2;

to w memo pokaze sie tylko updtVersion2 .

Jak mam je do siebie dodac tak zeby pokazywaly sie obydwa , ale nie zmieszane z sobą ?

0

Lines.Add

1 użytkowników online, w tym zalogowanych: 0, gości: 1