Wisdom.net-license
1. Why use license
License (license) as the name implies, my software can only be used on the specified machine. After all, many projects are not free, (say a digression, in fact, I use piracy, haha) Here our license is divided into 2 kinds of 1, the trial version shows that the number of users and the period can only use 30 days, 2, the official version limit the number of days stipulated in the contract, the following we look at, How license is implemented in the wisdom.net.
2. The license in Do.net
There are several classes in the System.ComponentModel namespace:
1.License provides an abstract base class for all licenses, and a license grants a specific instance of the component.
2.LicenseContext Specifies when authorized objects can be used, and provides a way to obtain additional services that are required to support licenses that run within their domain.
3.LicenseException represents the exception that is thrown when a component cannot be granted a license
3. The license in wisdom.net
1. Define the Wisdomnetlicense class, where AES encryption is used and stored in the License.src file. Complete the issuing process. If you want to limit your MAC address, simply add the information on the MAC address above to qualify the software to run on only one server.
Public classWisdomnetlicense {/// <summary> ///License Type/// </summary> PublicLicenseType type{Get;Set;} /// <summary> ///date of issuing the certificate/// </summary> PublicDateTime StartTime {Get;Set; } /// <summary> ///End Date/// </summary> PublicDateTime EndTime {Get;Set; } /// <summary> ///Effective Days/// </summary> Public intDays {Get;Set; } } Public enumLicenseType {temporary, longterm}
2. Check License
In Wisdom.net we let the user import license in fact, it is said that the above license.src file upload to a directory, after we add the following validation process in the page base class can be as follows:
(Figure I)
That's what I thought about license a little bit immature.