Click or drag to resize

SKMKeyDeactivation Method

This method will attempt to de-activate a machine code from the given key. If the given machine code was de-activated, KeyInformation confirming the key and the machine code will be returned. If something went wrong, for instance, if the machine code did not exist, null will be returned.

Namespace:  SKGL
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public static KeyInformation KeyDeactivation(
	string pid,
	string uid,
	string hsum,
	string sid,
	string mid
)

Parameters

pid
Type: SystemString
pid
uid
Type: SystemString
uid
hsum
Type: SystemString
hsum
sid
Type: SystemString
Machine code's serial key.
mid
Type: SystemString
Machine code

Return Value

Type: KeyInformation
Returns a KeyInformation object (with a key and machine code only) or null.
Remarks
In Debug mode, the error is going to be displayed in the Output Window.
Note: The key is going to be stored in "NewKey" field, while the machine code is going to be stored in "mid".
Examples
The following code demonstrates activation of a machine code followed by its deactivation.
C#
public void KeyDeactivationTest()
{
    // first, we need to activate a machine code. In this case, it's "artem123"
    var activationResult = SKGL.SKM.KeyActivation("2196", "2", "749172", "KTDOU-JZQUY-NOJCU-ECTAA", "artem123");

    if(!activationResult.IsValid())
    {
        Assert.Fail("Unable to activate");
    }

    // now, let's deactivate it:

    var deactivationResult = SKGL.SKM.KeyDeactivation("2196", "2", "749172", "KTDOU-JZQUY-NOJCU-ECTAA", "artem123");

    if(!deactivationResult.IsValid())
    {
        Assert.Fail("Unable to deactivate");
    }

    // if we are here, the machine code "artem123" was successfully deactivated.

}
See Also