Пример #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            AUXMethods tAux = new AUXMethods();

            if (CWProductProtection.Activate(tAux.CodifyData(txtFName.Text, txtLName.Text, txtPhone.Text, txtEmail.Text), txtActivation.Text))
            {
                MessageBox.Show("Activation Successful!", "Activation Successful!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Activation Failed!", "Activation Failes!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void cmdGenKey_Click(object sender, EventArgs e)
        {
            if (!CWProductProtection.IsProductActivated)
            {
                AUXMethods tAux = new AUXMethods();

                String data = tAux.CodifyData(txtFName.Text, txtLName.Text, txtPhone.Text, txtEmail.Text);
                CWProductProtection.Activate(data, txtKey.Text);
                if (CWProductProtection.IsProductActivated)
                {
                    MessageBox.Show(CWProductProtection.ACTIVATION_SUCCESS, "Activation Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show(CWProductProtection.ACTIVATION_FAILURE, "Activation Failure", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                CWProductProtection.IntelligentSecureControls(this.MdiParent);
            }
        }