SK_GetLicenseStatus()

Get the Status of a License from SOLO

Applies to:

Win32, Win64

Syntax-VB:

Declare Function SK_GetLicenseStatus(ByVal server As String, ByVal proxy As String, ByVal url As String, ByVal licenseid As Long, ByVal pw As String, ByVal status As String, ByRef replacedby As Long, ByVal licenseupdate As String) As Long

Syntax-C:

LONG SK_GetLicenseStatus(LPSTR server, LPSTR proxy, LPSTR url, LONG licenseid, LPSTR pw, LPSTR status, LPLONG replacedby, LPSTR licenseupd)

Arguments:

<server> is the name or IP address of the SOLO server (do not use prefix of "http://"). For Instant SOLO, use "swk".

<proxy> is the name or IP address and port of any proxy server necessary to access the Internet. The format is server:port. Eg) proxy.consoft.com:80.

<url> is the document path and name to use (must start with "/"). For Instant SOLO, use "/solo/customers/getlicensestatus.asp".

<licenseid> is the LicenseID of the user

<pw> is the Customer Password of the user

<status> is the buffer to place the license status

<replacedby> is a buffer to place the LicenseID that replaces this license, if any.

<licenseupd> is any LicenseUpdate value from the SOLO server, or 0 to ignore this parameter

Returns:

In addition to the possible return values described in SK_GetErrorStr(), the SOLO server may respond with the value of 100 or greater. The value of 100 means that the data was received properly but that the data entered by the user was not found in the license database. You can display a specific message to this effect when you receive this error code. The HTML necessary to return a specific error code is Error Response = 100 (space equals space then data).

The value of the License Status, Licensed ReplacedBy, and License Update fields will be returned via the last three parameters. If the server indicates that this license was replaced, you can then re-query the server for the status of the new LicenseID.

HTTP Method:

GET

Variables sent:

LicenseID

CustomerPW

HTML Return Strings:

License Status = (space equals space then data)

License ReplacedBy =

License Update =

Description:

This function is used to retrieve the current license status from the SOLO server. This is a string flag stored in the license database that exists for all licenses sold through the server. Your application can periodically poll the server for the license status to see if the license has been revoked and the application should stop working.

Example:

Dim result as Long

Dim status As String

 

' LicenseID and LicensePW were stored in

' the License File and were retrieved previously

 

' see if the license is still valid

status = Space(15)

result = SK_GetLicenseStatus("swk", "", "/solo/customers/getlicensestatus.asp", LicenseID, LicensePW, status, 0, 0)

 

' trim of the extra spaces

status = Trim(status)

status = Left(status, Len(status) - 1)

 

Select Case status

 Case "RET"

MsgBox "Our records indicate that this software license was returned for credit. Contact support@softwarekey.com with any questions." 

' turn off the software 

pp_setvarchar lfhandle, VAR_EXPIRE_TYPE, "D" 

pp_setvardate lfhandle, VAR_EXP_DATE_HARD, 1, 1, 2000 

pp_copydelete lfhandle, -1 

pp_upddate lfhandle, 0 

End 

Case "FRD" 

MsgBox "This software license has been revoked. Contact support@softwarekey.com with any questions." 

' turn off the software 

pp_setvarchar lfhandle, VAR_EXPIRE_TYPE, "D" 

pp_setvardate lfhandle, VAR_EXP_DATE_HARD, 1, 1, 2000 

pp_copydelete lfhandle, -1 

pp_upddate lfhandle, 0 

End 

End Select