Request Key

Top  Previous  Next

 

There are two examples Request Key 1 and 2. Very similar, only with a scenario slightly different.

 

Request Key 1

 

The scenario is as follow:

 

1. The application will have Two kind of features a) Free features for everybody, and b) Features for registered users.

 

2. You will encourage to the user to request a key in order to register the application temporarily by a trial period of 30 days.

 

3. The registration form will have fields for the user data; User name, Company and email and a button [Request Key]. Also a field for the registration key with a button [Register].

 

4. To request the key the user enters his data into the fields then press the [Request Key] button.

 

5. The OLM (Online License Manager) into the web site receive the user data then calculate the appropriate registration key and send it to the user via email. This will ensure the user entered a real email address to receive the key, so you could collect this data thinking on a future marketing campaign.

 

6. The user receive the key via email then enter the key into the proper field and press the [Register] button. The key will be registered and the trial period started.

 

7. Finally when the user purchased your product you have two options:

a) you can modify the record into the OLM to generate a new key for the full version. The registration status will be synchronized with the OnlineRenew() method the next time the user starts the program.

b) you can calculate the key using the KeyGen utility and send it by email to the user.

 

The example step by step

 

Open the example in your Delphi IDE and run it. You will see the following form. This is the registration form.

 

demo06_regform

If the user do not want to register just now, then he can press the [Continue >>] button to go to the Main Form of the application.

 

Please see that there only the first button is enabled  [Free Features for everybody].

 

The idea is to encourage to the user to register for free a trial period in order to have access to the second button [Features for Registered users].

 

demo06_mainform1

 

When the user decides to start the trial period, clicks the button [Registration Form] to request the key. Then fills the three fields, User Name, Company and Email and sends the request clicking the button [Request Key]. See the image below:

 

demo06_request

 

The user will receive an email like this:

______________________________________

Dear User,

 

Thank you for your request.

 

Your Key is:  ED4ANNZ-DVDDLCN-T0RXJXP-CC9R02V

 

Best regards,

_______________________________________

 

If the user enters an dummy email address will not receive the registration key, however, still a new record will be created into the OLM to save the user data and the registration key. So, the user will have the chance to request again the key with a real email address to receive the key, in this case the email received will be like this:

 

______________________________________

Dear User,

 

Previously you already requested a key to start the trial period.

However, if you experienced problems to start it, please try again with this Key:

 

ED4ANNZ-DVDDLCN-T0RXJXP-CC9R02V

 

Best regards,

_______________________________________

 

Then the user register the key. Enters the Registration key into the Register Now section then clicks the [Register] button.

 

 

demo06_regist1

 

The trial period has been started and it is in the first of 30 days availables.

 

demo06_regist2

 

Now the features for registered users will be available by 30 days.

demo06_mainform3

 

When the user pay for your soft then you have two ways to register your application into the user machine:

 

1. Using the KeyGen utility to calculate the registration key.

 

demo06_keygen1

 

Then send to the user the registration key by email in order to register it at the same way that was done with the trial key as shown in the prior example.

 

 

2. Using the OLM control panel to change the record to generate a new definitive key when the user starts again the application.

 

Open the OLM control panel using your preferred web browser from this link:

 

http://av-soft.com/olm5/s5cp.php

 

The password is abc123

 

Search the record using the "search for" field:

 

demo06_cpanel0

Identify the record by the AppID and InstallCode. Below is the full record for the example:

 

demo06_cpanel1

 

Click the Edit Icon editicon. This will display the Edit Form as shown below:

 

demo06_cpanel2

 

Chose the radio button "The user paid for a new key (Paid = Y). Set values below:"

 

Then chose below "Permanent license (no time limit)". Finally click the [Save Record] button.

 

You will receive the message "Record Saved".

 

Click again the [-> Go] button to refresh the panel status. See the image below:

 

demo06_cpanel3

 

Please note that only were changed the fields "Days" and "Paid". 65535 mean "no time limit" and Payd=Y will trigger the key generation the next time the user start the application.

The key still is the same, this will change when the user start the application the next time. The OnlineRenew() method into the OnCreate event manager will trigger it, below is the source:

 

procedure TRegForm.FormCreate(Sender: TObject);

begin

 GetRegStatus;

 if (keydata.Status <> registered) or (keydata.KeyType = Trial)

 then  begin

   AVLock.OnlineRenew(0);

   GetRegStatus;

 end;

end;

 

 

Please review the source code, this is quite clear. I will mention only the code for the [Request Key] button:

 

procedure TRegForm.BtnRequestClick(Sender: TObject);

var s, fromname, fromemail, subj, msg1, msg2, vals:string;

  days,inst,usrs,kind,idx:integer;

begin

 if not testfields(false) then exit;

 fromname:='Sales AV-Soft';

 fromemail:='sales@valega.com';

 subj:='Registration Key';

 msg1:= 'Dear '+edname.Text+',<CR><CR>Previously you already requested a key to start the trial period.<CR>'+

 'However, if you experienced problems to start it, please try again with this Key: <CR><CR><REGKEY><CR><CR>Best regards,<CR>Alcides';

 msg2:= 'Dear '+edname.Text+',<CR><CR>Thank you for your request.<CR><CR>Your Key is: <REGKEY><CR><CR>Best regards,<CR>Alcides';

 vals:='000';

 days:=30;

 idx:=0;

 kind:=0;

 inst:=2;

 usrs:=1;

 s:=trim(AVLock.OnlineRequestKey(edname.Text, edcompany.Text, edemail.Text, fromname, fromemail, vals, subj, msg1, msg2,

 kind, idx, usrs, inst, days));

 if (s='00') then begin

   WriteData;

   AVLock.OnlineSynch(0);

   GetRegStatus;

   showmessage('Thank you very much. You will receive an email with your Registration Key')

 end else showmessage('Process fail. Error:'+s);

end;

 

 

Please note the msg1 and msg2 strings, msg1 to be used the first time when the record does not exists on the OLM and msg2, to be used when the record already exists. Note the <CR> and <REGKEY> tags, where into the OLM, <CR> will be replaced by #13#12 (carriage return and line feeds) and <REGKEY> replaced by the Registration Key.

 

Request Key 2

 

Very similar to the previous example. The scenario is as follow:

 

1. The application will have Three kind of features a) Free features for everybody,  b) Free features for registered users  and c) Features that require payment.

 

2. You will encourage to the user to request a key in order to register the application at not time limit in order to have access to the free features for registered users.

 

3. The registration form will have fields for the user data; User name, Company and email and a button [Request Key]. Also a field for the registration key with a button [Register].

 

4. To request the key the user enters his data into the fields then press the [Request Key] button.

 

5. The OLM (Online License Manager) into the web site receive the user data then calculate the appropriate registration key and send it to the user via email. This will ensure the user entered a real email address to receive the key, so you could collect this data thinking on a future marketing campaign.

 

6. The user receive the key via email then enter the key into the proper field and press the [Register] button. The key will be registered and the free features for registered users allowed for ever.

 

7. Finally, if the user needs "Features that require payment", make payment and request the new key to activate these features. Then, you have two options:

a) You can modify the record in the OLM to generate a new key, the only difference with the previous example is that now the "value" should be "001" to differentiate it from the previous key. The registration status is synchronized with the OnlineRenew() function the next time the user starts the program.

b) you can calculate the key and send it by email to the user.

 

 

I tried to make this help as clear and complete as possible, however they may have some issues not covered by this documentation. If you think I have missed something, or found errors, or have any idea that might be useful to improve this help, please let me know.

 


  Alcides Valega

Author of AVLock SIMPLE