Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating an Application to run for a Limited Period
Message
De
26/09/2013 08:08:09
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
26/09/2013 07:52:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01584183
Message ID:
01584185
Vues:
62
>1st
>I need to create an application for Demo purpose. How to create an application that should not work after 6 Months of its creation.
>
>2nd
>I need to create an application that the user use it for a limited period and that application should process only 50000 Records in a Year. If the Records are over 50000 it will not run. How to create such application, that it is a tuff job to crack by someone.
>
>Regards

1)

Please note that the user can easily change the computer clock, although that may be a nuisance to do actual work.

We did something similar, that is, I did it with a client. You can store the starting date and an interval (for example, 180 days) in a table. Calculate a time period, so that the first 180 days will be period 0, the next 180 days period 1, etc. (use date subtraction, division, and the int() function). Then, calculate a hash from the date, the interval, and the number of the time period (and perhaps some additional information you want to include) and call this the "activation code". When starting the application, calculate the activation code, and see if the correct activation code is stored. Otherwise ask the user for the activation code, and if the user provides the correct code, store it for later program runs.

Note that if any of the

For the hash function, you can use a checksum, or search for safer functions such as MD5 or SHA1.

2)

It is far easier to limit the TOTAL number of records to a certain number. Just check the reccount(). Otherwise, if you really want to do it by year, you'll have to SELECT records that are between a certain range of dates; or perhaps faster, and assuming the records are in chronological order, SEEK() for the start of the date range, then for the end of the date range, get the recno() for each, and check how many there are in between. Be sure to consider the case that you don't have records for January 1st., for example; you must SET NEAR OFF, and check for the special case of being at the beginning or end of the file.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform