C# Класс ComponentFactory.Krypton.Ribbon.EvaluationMonitor

Provides a mechanism for managing time/usage limited evaluations of products.

Instantiate an instance of this class to read/write the evaluation parameters for the given product. The FirstUseDate is set the first time that the class is instantiated. The LastUseDate is set each time the class is instantiated. The UsageCount is incremented each time the class is instantiated.

Note that evaluation data must be stored somewhere on the users hard disk. It is therefore not too difficult for a sophisticated user to determine the changes made either to registry keys or files (using file/registry monitoring software) and restore the state of these to their pre-installation state (thus resetting the evaluation period). For this reason it is recommended that you don't rely on this mechanism alone. You should also consider limiting the functionality of your product in some way or adding nag screens to discourage long term use of evaluation versions.

If you have a data oriented application you can increase the security of evaluations by storing the current UsageCount somewhere in your database each time the application runs and cross checking this with the number returned by the EvaluationMonitor.

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void

Free resources used by the EvaluationMonitor

EvaluationMonitor ( string productID ) : System

Initialize a new instance of the evaluation monitor.

The UsageCount is incremented each time a new evaluation monitor is instantiated for a product

Reset ( ) : void

Allows you to reset the evaluation period.

This may be useful if a customer needs an extension or if somehow they invalidate their evaluation data by attempting to fiddle

Приватные методы

Метод Описание
CreateBaseKey ( RegistryKey parent ) : void

Create the base key for this product

Decrypt ( byte data ) : string

Decrypt the given byte data to text

Encrypt ( string text ) : byte[]

Encrypt the given text

Equals ( byte a1, byte a2 ) : bool

Are the contents of the two byte arrays equal

FindBaseKey ( RegistryKey parent ) : RegistryKey

Find the base key for this product

GetDateData ( ) : void

Calculate the number of days the product has been in use

GetUsageData ( ) : void

Get the number of times the product has been used (and increment)

Описание методов

Dispose() публичный Метод

Free resources used by the EvaluationMonitor
public Dispose ( ) : void
Результат void

EvaluationMonitor() публичный Метод

Initialize a new instance of the evaluation monitor.
The UsageCount is incremented each time a new evaluation monitor is instantiated for a product
public EvaluationMonitor ( string productID ) : System
productID string A string which uniquely identifies the product
Результат System

Reset() публичный Метод

Allows you to reset the evaluation period.
This may be useful if a customer needs an extension or if somehow they invalidate their evaluation data by attempting to fiddle
public Reset ( ) : void
Результат void