Click or drag to resize

KeyAddFeature Method

This method will change a given feature to be true (in a license). If the key algorithm in the product is SKGL, the key string will be changed if necessary. Otherwise, if SKM15 is used, the key will stay the same. If the key is changed, the new key will be stored in the message.

Namespace:  SKM.V3.Methods
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static BasicResult AddFeature(
	string token,
	FeatureModel parameters
)

Parameters

token
Type: SystemString
The access token. Read more at https://serialkeymanager.com/docs/api/v3/Auth
parameters
Type: SKM.V3.ModelsFeatureModel
The parameters that the method needs.

Return Value

Type: BasicResult
A BasicResult object or null.
Remarks
This method may, in rare cases, return null if an error has occurred. Null should be seen as an unsuccessful result.
Examples
Here is an example that demonstrates the use of the method.
C#
public void AddFeatureTest()
{
    var keydata = new FeatureModel() { Key = "LXWVI-HSJDU-CADTC-BAJGW", Feature = 2, ProductId = 3349 };
    var auth = new AuthDetails() { Token = "WyI2Iiwib3lFQjFGYk5pTHYrelhIK2pveWdReDdEMXd4ZDlQUFB3aGpCdTRxZiJd" };

    var result = SKM.AddFeature(auth, keydata);

    if (result != null && result.Result == ResultType.Success)
    {
        // feature 2 is set to true.
    }
    else
    {
        Assert.Fail();
    }
}
See Also