private void button2_Click(object sender, EventArgs e) { //Data must be formatted in the same manner as it is //in the key generator. AUXMethods tAux = new AUXMethods(); String data = tAux.CodifyData(txtFName.Text, txtLName.Text, txtPhone.Text, txtEmail.Text); CWActivationLibrary.CWActivationKeyGenerator temp = new CWActivationKeyGenerator(); txtKey.Text = temp.GenerateActivationKey(data); }
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); } }