unit Main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TMainForm = class(TForm)
    Memo: TMemo;
    OpenDialog: TOpenDialog;
    Panel1: TPanel;
    btnCLOSE: TBitBtn;
    btnWCZYTAJ: TBitBtn;
    procedure FormShow(Sender: TObject);
    procedure btnWCZYTAJClick(Sender: TObject);
    procedure btnCLOSEClick(Sender: TObject);

  private
    procedure Czytaj_z_pliku(fn : String);
  public

  end;

var
  MainForm: TMainForm;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TMainForm.FormShow(Sender: TObject);
begin
   Memo.Clear();
   Memo.Align := alClient;
end;

procedure TMainForm.btnCLOSEClick(Sender: TObject);
begin
	Close();
end;

procedure TMainForm.btnWCZYTAJClick(Sender: TObject);
var
	fn : String;

begin
   fn := 'License.txt';

   Czytaj_z_pliku(fn);
end;

procedure TMainForm.Czytaj_z_pliku(fn: String);
var
	Lista : TStringList;

begin
   Lista := TStringList.Create();
   Lista.LoadFromFile(fn);

   Memo.Lines.Add(Lista.Text);

   if Assigned(Lista) then
   begin
    	Lista.Clear();
      FreeAndNil(Lista);
   end;
end;

end.
