public frmCWProtectionTestMain() { InitializeComponent(); CWProductProtection.AddControlledObject("ControlledForm"); //CWProductProtection.AddControlledObject("controlledFormToolStripMenuItem"); CWProductProtection.AddControlledObject("controlledItem2ToolStripMenuItem"); //CWProductProtection.AddControlledObject("controlledDD1ToolStripMenuItem"); CWProductProtection.AddControlledObject("controlledSubItemToolStripMenuItem"); CWProductProtection.AddControlledObject("cmdButton1"); this.Text += "Activation Count:" + CWProductProtection.GetNumberOfActivations().ToString(); if (CWProductProtection.IsProductActivated == false && CWProductProtection.HasEvaluationPeriodExpired) { CWProductProtection.IntelligentSecureControls(this); MessageBox.Show("Your product trial period has expired! Please register and activate your product to continue use.", "Trial Period Expired.", 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); } }
private void ControlledForm_Load(object sender, EventArgs e) { CWProductProtection.IntelligentSecureControls(this); }