private TrialLicenseInfo GetTrialLicenseInfo() { lock (trialLicenseInfoLock) { var trialLicenseInfo = new TrialLicenseInfo(); int status = 0; try { var sbTrialId = new StringBuilder(256); status = LexActivator.GetTrialId(sbTrialId, 256); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } trialLicenseInfo.TrialId = sbTrialId.ToString(); } catch { } try { var sbFirstName = new StringBuilder(256); status = LexActivator.GetTrialActivationMetadata("FirstName", sbFirstName, 256); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } trialLicenseInfo.FirstName = sbFirstName.ToString(); } catch { } try { var sbLastName = new StringBuilder(256); status = LexActivator.GetTrialActivationMetadata("LastName", sbLastName, 256); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } trialLicenseInfo.LastName = sbLastName.ToString(); } catch { } try { var sbEMail = new StringBuilder(256); status = LexActivator.GetTrialActivationMetadata("eMail", sbEMail, 256); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } trialLicenseInfo.EMail = sbEMail.ToString(); } catch { } try { var sbOrganization = new StringBuilder(256); status = LexActivator.GetTrialActivationMetadata("Organization", sbOrganization, 256); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } trialLicenseInfo.Organization = sbOrganization.ToString(); } catch { } try { var sbIndexer = new StringBuilder(256); status = LexActivator.GetTrialActivationMetadata("Indexer01", sbIndexer, 256); if (status == LexActivator.StatusCodes.LA_OK) { trialLicenseInfo.Indexer01 = sbIndexer.ToString(); } } catch { } try { uint trialExpiryDate = 0; status = LexActivator.GetTrialExpiryDate(ref trialExpiryDate); if (status != LexActivator.StatusCodes.LA_OK) { return(null); } var expireDate = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); var TrialDueDate = expireDate.AddSeconds(trialExpiryDate).ToLocalTime(); trialLicenseInfo.TrialDueDate = TrialDueDate; } catch { } return(trialLicenseInfo); } }