unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DateUtils, StdCtrls, shellapi, IniFiles;
const
Section = '
Freischaltung';
Key = '
Testbeginn';
LuPhiCode = $9A53;
TrialDays = 30;
type
TForm1 =
class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
ini: TiniFile;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
StartDay: Word;
begin
Ini := TIniFile.Create(ExtractFilePath(ParamStr(0))+'
config.ini');
StartDay := ini.ReadInteger(Section, Key, 0);
if (StartDay = 0)
or (DaysBetween(date, StartDay
xor LuPhiCode) > TrialDays)
then
ShowMessage('
30 Tage Trial vorbei')
// Programm beenden
else
ShowMessage('
Trial weiter');
end;
// Weiter
end.