private void dropBtn_Click(object sender, EventArgs e) { try { if (!LexFloatClient.HasFloatingLicense()) { return; } LexFloatClient.DropFloatingLicense(); this.statusLabel.Text = "License dropped successfully!"; } catch (LexFloatClientException ex) { this.statusLabel.Text = "Error code: " + ex.Code.ToString() + " Error message: " + ex.Message; } }
private void dropBtn_Click(object sender, EventArgs e) { if (LexFloatClient.HasFloatingLicense() != LexFloatClient.StatusCodes.LF_OK) { return; } int status; status = LexFloatClient.DropFloatingLicense(); if (status != LexFloatClient.StatusCodes.LF_OK) { this.statusLabel.Text = "Error dropping license: " + status.ToString(); return; } this.statusLabel.Text = "License dropped successfully!"; }
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(); }