private void leaseBtn_Click(object sender, EventArgs e) { if (LexFloatClient.HasFloatingLicense() == LexFloatClient.StatusCodes.LF_OK) { return; } int status; status = LexFloatClient.SetHostProductId("PASTE_YOUR_PRODUCT_ID"); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting product id: " + status.ToString(); return; } status = LexFloatClient.SetHostUrl("http://localhost:8090"); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting host url: " + status.ToString(); return; } status = LexFloatClient.SetFloatingLicenseCallback(LicenceRenewCallback); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error setting callback function: " + status.ToString(); return; } status = LexFloatClient.RequestFloatingLicense(); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error requesting license: " + status.ToString(); return; } this.statusLabel.Text = "License leased successfully!"; }
private void leaseBtn_Click(object sender, EventArgs e) { try { LexFloatClient.SetHostProductId("PASTE_YOUR_PRODUCT_ID"); LexFloatClient.SetHostUrl("http://localhost:8090"); LexFloatClient.SetFloatingLicenseCallback(LicenceRenewCallback); LexFloatClient.RequestFloatingLicense(); this.statusLabel.Text = "License leased successfully!"; } catch (LexFloatClientException ex) { this.statusLabel.Text = "Error code: " + ex.Code.ToString() + " Error message: " + ex.Message; } }
static void Main(string[] args) { try { LexFloatClient.SetHostProductId("PASTE_PRODUCT_ID"); LexFloatClient.SetHostUrl("http://localhost:8090"); LexFloatClient.SetFloatingLicenseCallback(LicenseRenewCallback); LexFloatClient.RequestFloatingLicense(); Console.WriteLine("Success! License acquired."); Console.WriteLine("Press Enter to drop the license ..."); Console.ReadKey(); LexFloatClient.DropFloatingLicense(); Console.WriteLine("Success! License dropped successfully."); } catch (LexFloatClientException ex) { Console.WriteLine("Error code: " + ex.Code.ToString() + " Error message: " + ex.Message); } Console.WriteLine("Press any key to exit"); Console.ReadKey(); }