WisDom. Net Framework Design (6) license

Source: Internet
Author: User

WisDom. Net-license

 

1. Why use license?

License, as its name implies, means that my software can only be used on a specified machine. After all, many projects are not free of charge. (I actually use pirated files. Haha) Here we have two types of licenses, the trial version shows that the number of users and term of use can only be 30 days, 2. the official version limits the number of days specified in the contract. Let's take a look at it,How to Implement the license in WisDom. Net.

2. license in Do. NET

The System. ComponentModel namespace contains the following classes:

1. License An abstract base class is provided for all licenses, and a license is granted to a specific instance of the component.

2. LicenseContext Specifies when an authorized object can be used and provides a method to obtain additional services required to support a license running within its domain.

3. LicenseException indicates the exception that occurs when the component cannot be licensed.

3.WisDom. NetLicense in

1. Define the WisDomNetLicense class, which is encrypted by AES and stored in the License. src file. Complete the issuing process. If you want to limit the MAC address, you only need to add the Mac address information above to limit that the software can only run on a server.

Public class WisDomNetLicense {// <summary> // license type /// </summary> public LicenseType {get; set ;} /// <summary> /// date of issuance /// </summary> public DateTime StartTime {get; set ;} /// <summary> /// end date /// </summary> public DateTime EndTime {get; set ;} /// <summary> /// valid days /// </summary> public int days {get; set ;}} public enum LicenseType {Temporary, Longterm}

2. Verify License

In wisdom.net, let the user import the License, which is to say that the above License. src file is uploaded to a directory. Then we add the following verification process to the page base class:

(Figure 1)

The above is my immature idea about License.

 

 

 

Related Article

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.