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.