C #: Restrictions on the service life of the software,

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.