//string LICENSEdIR = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\PrintAPic";

        private void Button1_Click(object sender, EventArgs e)
        {
            //check standard directory
            if (!Directory.Exists(Globals.StandardLicPath))
            {
                Directory.CreateDirectory(Globals.StandardLicPath);
            }

            label5.Text = "";
            if (string.IsNullOrWhiteSpace(textBox1.Text) ||
                string.IsNullOrWhiteSpace(textBox2.Text) ||
                string.IsNullOrWhiteSpace(textBox4.Text))
            {
                label5.Text = "Please fill all fields";
                return;
            }
            string requestText = Licensing.GetUniqueSystemIDs(
                textBox1.Text, textBox2.Text, textBox4.Text, comboBox1.Items[comboBox1.SelectedIndex].ToString());

            File.WriteAllText(Globals.StandardLicPath + "\\" + "LicenseReq.txt", requestText);



            label6.Visible  = true;
            label7.Visible  = true;
            label8.Visible  = true;
            button2.Visible = true;
            label8.Text     = Globals.StandardLicPath;
        }
        private void Registration_Load(object sender, EventArgs e)
        {
            string error = "";

            IS_LICENSE_VALID = Licensing.validateLicense(out error);
            if (IS_LICENSE_VALID)
            {
                label5.Text = "License is valid";
            }
            else
            {
                label5.Text = "No license available";
            }
        }
示例#3
0
        private void LicenseCheck()
        {
            string error   = "";
            bool   isvalid = Licensing.validateLicense(out error);

            Start_Button.Enabled = isvalid;
            Stop_Button.Enabled  = isvalid;
            if (isvalid)
            {
                Register_btn.BackColor = System.Drawing.Color.LightGreen;
                Register_btn.Text      = "Registered";
            }
            else
            {
                Register_btn.BackColor = System.Drawing.Color.LightSalmon;
                Register_btn.Text      = "Register";
            }
        }
        private void Button3_Click(object sender, EventArgs e)
        {
            SerialKey sform = new SerialKey();

            sform.ShowDialog();
            string error = "";

            IS_LICENSE_VALID = Licensing.validateLicense(out error);

            if (IS_LICENSE_VALID)
            {
                label5.Text = "License is valid";
            }
            else
            {
                label5.Text = "No license available";
                MessageBox.Show(error);
            }
        }