Ejemplo n.º 1
0
        private void registerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ActivationForm dialog = new ActivationForm();

            dialog.ShowDialog();
            if (dialog.DialogResult == DialogResult.OK)
            {
                try
                {
                    Cursor.Current = Cursors.WaitCursor;
                    license.Activate(dialog.SerialNumber);

                    license = ExtendedLicenseManager.GetLicense(typeof(MainForm), this, "your public key");
                    MessageBox.Show("The application has been activated.");
                    toolStripStatusLabel.Text = string.Empty;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    Cursor.Current = Cursors.Default;
                }
            }
        }
Ejemplo n.º 2
0
        private void ActivateProduct2Button_Click(object sender, EventArgs e)
        {
            ExtendedLicense license = ExtendedLicenseManager.GetLicense(typeof(Form1), this, "public key product 2");

            license.Activate("serial number 2", true, "licenseProduct2.lic");

            MessageBox.Show("done");
        }
Ejemplo n.º 3
0
        public MainForm()
        {
            InitializeComponent();
            this.license = ExtendedLicenseManager.GetLicense(typeof(MainForm), this, "your public key");

            this.calculator = new Calculator();
            this.calculator.CalculatorValueChanged += new Calculator.CalculatorValueChangedEventHandler(calculator_CalculatorValueChanged);
        }
Ejemplo n.º 4
0
        private void ValidateProduct2Button_Click(object sender, EventArgs e)
        {
            string licenseFolder = @"c:\ProgramData\IPManager\licenseProduct2.lic";

            if (File.Exists(licenseFolder))
            {
                LicenseValidationInfo info = new LicenseValidationInfo();
                info.LicenseFile = new LicenseFile(licenseFolder);

                ExtendedLicense license = ExtendedLicenseManager.GetLicense(typeof(Form1), this, info, "public key product 2");

                MessageBox.Show(license.Validate().ToString());
            }
        }