Topic: i want code Expire soft on Year,Month,Day

i want code Expire soft on Year,Month,Day,,

Re: i want code Expire soft on Year,Month,Day

First, please download beta version 1.46
https://www.dropbox.com/s/30ysr48sd8ca4 … 6.zip?dl=0


Example, how to make trial period

procedure Form1_OnShow (Sender: string; Action: string);
var
   reg: TRegistry;
   iDays: integer;
begin
     reg := TRegistry.Create;
     reg.Access := KEY_ALL_ACCESS;
     reg.RootKey := HKEY_CURRENT_USER;
     reg.OpenKey('software\MyVisualDatabaseTrial',true);
     if not reg.ValueExists('StartDate') then reg.WriteDate('StartDate', Now+10); // trial period is 10 days

     iDays := Trunc(reg.ReadDate('StartDate')) - Trunc(Now); // time left days

     reg.CloseKey;
     reg.Free;

     if iDays < 1 then
     begin
          ShowMessage('Trial period is over.');
          Form1.Close;
     end;

     ShowMessage('Demo version. Time left: ' + IntToStr(iDays));
end;

Also you can download example project.

Post's attachments

Attachment icon Trial.zip 1.55 kb, 555 downloads since 2014-10-17 

Dmitry.

Re: i want code Expire soft on Year,Month,Day

Hello everyone.

I used the 10-day trial period, ran the app, Ok.
Now I try to use a 365 day period and I can't. It always appears 10 days.
How do I change the date range?
Thanks.

Apologies for the google translator.

4 (edited by sibprogsistem 2021-01-29 14:58:21)

Re: i want code Expire soft on Year,Month,Day

lejoso wrote:

Hello everyone.

I used the 10-day trial period, ran the app, Ok.
Now I try to use a 365 day period and I can't. It always appears 10 days.
How do I change the date range?
Thanks.
Apologies for the google translator.

DELETE
HKEY_CURRENT_USER\SOFTWARE\MyVisualDatabaseTrial

Re: i want code Expire soft on Year,Month,Day

Thanks Sib

I try it

reg.WriteDate('StartDate', Now+365); 

But the message does not change. See the image https://ibb.co/F0GqtFh

Only stay 10 days .

Re: i want code Expire soft on Year,Month,Day

Open regedit from run
Open current user
Open softwares
Find Myvisualdatabasetrail
And Delete it....  if it not work then add new user account. Log on to new account .

Re: i want code Expire soft on Year,Month,Day

Thank you so much guys.
I got it.