1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
unit shareware;
interface
uses JvCipher, IniFiles, SysUtils, dateUtils;
function CheckValidity(Sender: TObject) : boolean;
var
JvVigenereCipher1: TJvVigenereCipher;
iniDataFile : TIniFile;
implementation
function CheckValidity(Sender: TObject) : Boolean;
begin
result:=False;
if Not FileExists('.\config.ini') then exit;
iniDataFile:=TIniFile.Create('.\config.ini');
JvVigenereCipher1.Encoded:=iniDataFile.ReadString('master','value1','');
if StrToDate(JvVigenereCipher1.Decoded) < Today then exit;
JvVigenereCipher1.Decoded:=DateToStr(today);
iniDataFile.WriteString('master','value3',JvVigenereCipher1.Encoded);
iniDataFile.Free;
result:=true;
end;
end. |
Partager