Click or drag to resize
Ab4d.SharpEngine logo

LicensingSetLicense(String, String, String) Method

SetLicense method sets the license parameters for the Ab4d.SharpEngine. The parameter values for the commercial version can be retrieved from the User Account web page on ab4d.com or from the ab4d.com/trial for trial version.

Namespace: Ab4d.SharpEngine
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntax
C#
public static void SetLicense(
	string licenseOwner,
	string licenseType,
	string license
)

Parameters

licenseOwner  String
license owner
licenseType  String
type of the license
license  String
license text
Remarks

SetLicense method sets the license parameters for the Ab4d.SharpEngine.

The parameter values for the commercial version can be retrieved from the User Account web page on ab4d.com or from the ab4d.com/trial for trial version.

Note that license is not checked immediately after calling this method.

Note that license is not checked immediately after calling this method.

If you are not referencing the Ab4d.SharpEngine from the entry assembly and you do not have an SDK license, then you can use the following code to call the SetLicense method using reflection.

C#
var licensingType = Type.GetType("Ab4d.SharpEngine.Licensing, Ab4d.SharpEngine");
if (licensingType != null)
{
    var setLicenseMethod = licensingType.GetMethod("SetLicense", BindingFlags.Public | BindingFlags.Static, new Type[] { typeof(string), typeof(string), typeof(string) });
    if (setLicenseMethod != null)
    {
        var setLicenseParams = new object[]
        {
            /* licenseOwner: */ "AB4D",
            /* licenseType:  */ "SamplesLicense",
            /* license:      */ "5B53-8A17-DAEB-5B03-3B90-DD5B-958B-CA4D-0B88-CE79-FBB4-6002-D9C9-19C2-AFF8-1662-B2B2"
        };
        setLicenseMethod.Invoke(null, setLicenseParams);
    }
}

See Also