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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
//
// DECLARATION DES VARIABLES DATE
//
TDateTime iDate ,
dDate ,
mDate ,
cDate ;
int nExec ;
cDate = Date() ;
//
// INSTANCIATION SUR LE REGISTRE
//
TRegistry *RegEdit = new TRegistry();
try
{
RegEdit -> RootKey = HKEY_LOCAL_MACHINE ;
if(RegEdit -> OpenKey("\\Software\\kmaniche\\", false))
{
iDate = RegEdit -> ReadDate ("iDate") ;
dDate = RegEdit -> ReadDate ("dDate") ;
mDate = RegEdit -> ReadDate ("mDate") ;
nExec = RegEdit -> ReadInteger("nExec") ;
if(nExec != 1350)
if((nExec != 27414)||((cDate<iDate)||(cDate>mDate)||(cDate<dDate)))
{
RegEdit -> WriteInteger("nExec", 41472) ;
Application -> Terminate() ;
}
else
RegEdit -> WriteDate("dDate", cDate) ;
}
else
{
RegEdit -> OpenKey("\\Software\\kmaniche\\", true) ;
RegEdit -> WriteDate ("iDate", cDate) ;
RegEdit -> WriteDate ("dDate", cDate) ;
RegEdit -> WriteDate ("mDate", cDate+30) ;
RegEdit -> WriteInteger("nExec", 27414) ;
}
}
__finally
{
if(RegEdit)
delete RegEdit ;
} |
Partager