...
Code Block |
---|
#include <stdio.h> #include <windows.h> #include "lac.h" int main() { LAC_STATUS LacStat; char szResponse[LAC_MAX_RESPONSE_LENGTH] = {0}; const char *szActivationKey = "9EFJK-TVJM0-MCDET-EZKXJ"; const char *szHostid = "HOSTNAME=my_hostname"; const char *szUrl = "http://license.x-formation.com/soap/type/enduser/version/1"; if ((LacStat = LAC_CreateLicenseRequest(szActivationKey, szHostid, szUrl, NULL, 0, NULL, NULL, szResponse)) != LAC_SUCCESS) { printffprintf(stderr, "Error code: %d\n", LacStat); if (strlen(szResponse) > 0) { printffprintf(stderr, "Error message: %s\n", szResponse); } return 1; } do { LacStat = LAC_GetLicense(szActivationKey, szHostid, szUrl, NULL, 0, NULL, NULL, szResponse); if (LacStat == LAC_SUCCESS) { break; } else if (LacStat != LAC_PLEASE_WAIT) { printffprintf(stderr, "Error code: %d\n", LacStat); if (strlen(szResponse) > 0) { printffprintf(stderr, "Error message: %s\n", szResponse); } return 1; } Sleep(2000); } while (LacStat != LAC_SUCCESS); printf("License:\n\n%s\n", szResponse); return 0; } |