Click or drag to resize
GetTcData Class

Implementation for calling server-side scripts which were originally designed to with with the Automation Client's SK_GetTCData and SK_GetTCDataEx functions.

Inheritance Hierarchy

Namespace: com.softwarekey.Client.Compatibility.ProtectionPLUS4
Assembly: PLUSManaged (in PLUSManaged.dll) Version: 5.17.4.0
Syntax
public class GetTcData : AutomationClientWebFormCall

The GetTcData type exposes the following members.

Constructors
  NameDescription
Public methodGetTcData
Creates a new GetTcData object.
Top
Properties
  NameDescription
Public propertyActivationCode1
Gets Activation Code 1. This is also known as "RegKey1" in Protection PLUS 4, and will be populated with a Protection PLUS 4 compatible activation code (or "Trigger Code") after processing the codes using ValidateTriggerCode(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).
Public propertyActivationCode2
Gets or sets Activation Code 2. This is also known as "RegKey2" in Protection PLUS 4, and may be populated with a Protection PLUS 4 compatible activation code (or "Trigger Code") after processing the codes using ValidateTriggerCode(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32).
Public propertyAutomationClientErrorCode
Gets or sets the Automation Client error code.
(Inherited from AutomationClientWebFormCall.)
Public propertyContentEncoding
Gets or sets the encoding used for the request and response (UTF-8 is the default).
(Inherited from WebFormCall.)
Public propertyContentType
Gets or sets the content type ("application/x-www-form-urlencoded" is the default).
(Inherited from WebFormCall.)
Public propertyLastException
Gets or sets the last Exception that occurred when calling the web form.
(Inherited from WebFormCall.)
Public propertyLicenseID
Gets or sets the License ID (required).
Public propertyLicenseUpdate
Gets the License Update data.
Public propertyPassword
Gets or sets password (required).
Public propertyProductID
Gets or sets the Product ID. When specified, the License ID must be for the Product ID specified.
Public propertyProductOptionID
Gets or sets the Product Option ID. When set, the License ID must be for the Product Option ID specified.
Public propertyProxy
Gets or sets the proxy server settings. Leave as null/Nothing to use the system's default proxy settings.
(Inherited from WebFormCall.)
Public propertyProxyAuthenticationRequired
Gets or sets whether the proxy server requires authentication.
(Inherited from WebFormCall.)
Public propertyRequireSsl
Gets or sets whether or not SSL is required.
(Inherited from WebFormCall.)
Public propertyResponse
Gets or sets the response returned from the server.
(Inherited from WebFormCall.)
Public propertyStatusCode
Gets or sets the status code of the response returned from the server.
(Inherited from WebFormCall.)
Public propertyTimeout
Gets or sets the timeout (in milliseconds). The default is 30000 milliseconds (or 30 seconds).
(Inherited from WebFormCall.)
Public propertyUserCode1
Gets or sets User Code 1 (required). In Protection PLUS 4, this is also referred to as the "Session Code" or "cenum". This value can be generated using PLUS4Methods.GenerateUserCode1Value.
Public propertyUserCode2
Gets or sets User Code 2 (required). In Protection PLUS, this is also referred to as the "Computer ID". This value can be generated using PLUS4Methods.GenerateUserCode2Value.
Top
Methods
Remarks

In general, if you are using SOLO Server, you should be using License.ActivateInstallationLicenseFile or the WebServiceCall implementation for activation.

Note Note

Before calling the CallWebForm method, the following properties must be set:

  • LicenseID
  • Password
  • UserCode1, which is also referred to as the "Session Code" or "cenum" in Protection PLUS 4.
  • UserCode2, which is also referred to as the Computer ID in Protection PLUS 4.

Optional fields that may be populated before calling CallWebForm method include:

  • ProductID - When set, the License ID specified must be for the specified Product ID. In most cases, this should match the value used in License.ThisProductID.
  • ProductOptionID - When set, the License ID specified must be for the specified Product Option ID.
Examples
This example shows how to make a typical activation call for a PLUSManaged license:
public bool ActivateOnline(int licenseID, string password, int userCode1, int userCode2, int productID, out int activationCode1, out int activationCode2, out string licenseUpdate)
{
    //TODO: The URL used below is for Instant SOLO Server.  You will need to update this URL if you are using Instant SOLO Server Dedicated URL, or SOLO Server.
    GetTcData activationCall = new GetTcData("https://secure.softwarekey.com/solo/unlock/getcode.asp");
    activationCall.LicenseID = licenseID;
    activationCall.Password = password;
    activationCall.UserCode1 = userCode1;
    activationCall.UserCode2 = userCode2;
    activationCall.ProductID = productID;

    //TODO: Initialize the Proxy property here as appropriate if you need to support proxy server authentication.

    bool successful = activationCall.CallWebForm();
    if (successful)
    {
        activationCode1 = activationCall.ActivationCode1;
        activationCode2 = activationCall.ActivationCode2;
        licenseUpdate = activationCall.LicenseUpdate;
    }
    else
    {
        activationCode1 = 0;
        activationCode2 = 0;
        licenseUpdate = "";
        //TODO: Evaluate the AutomationClientErrorCode, LastException, and ProxyAuthenticationRequired properties for possible reasons why the call failed.
    }

    return successful;
}
See Also