C #: Restrictions on the service life of the software,
When developing commercial software, you need to add a service life function to the software.
Without network connection, how can we ensure that the software is not so easy to be cracked "?
Ideas:
1. Save the initial running time and expiration time of the software to the Registry without turning back the time.
The first time and end time are generated by software developers and sent to the customer through the registration code.
Each time you run the software, the current time is compared with the first time in the registry.
If (current time-first time> 1 day or current time> end time ){
Software exit ();
} Else {
First time = current time;
}
If the time difference exceeds one day or the current time is greater than the end time of the expiration time, exit. Otherwise, use the current time to update the first time.
The software has a built-in timer used to calculate the run time of the software. When exiting the software, the first time + run time results of the software are used to update the first time.
First time = first time + run time;
With the above steps, you can ensure that the time is not "Reversed ".
Note: The above are only simple anti-cracking measures for software with low circulation. For general-purpose software, the above measures are obviously not applicable.