private void btnEmbedPersistedObject_Click(object sender, EventArgs e) { PeriodType type = PeriodType.DAYS; CWSteganography cwStegan = new CWSteganography(); switch (cbPeriodType.SelectedItem.ToString()) { case "HOURS": type = PeriodType.HOURS; break; case "DAYS": type = PeriodType.DAYS; break; case "MONTHS": type = PeriodType.MONTHS; break; case "ACTIVATIONS": type = PeriodType.ACTIVATIONS; break; default: type = PeriodType.DAYS; break; } //Initilize The Object With Basic Information. CWProductProtection.Initilize(@".\Temp.po", 0, txtPackageName.Text, DateTime.Now, Convert.ToInt32(txtTrialPeriod.Text), type); cwStegan.AppendBinaryFileToBinaryFile(@".\Temp.po", findLogoFileDialog.FileName); File.Delete(@".\Temp.po"); }
static void Main() { CWProductProtection.Initilize(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmCWProtectionTestMain()); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); String mFileName = @".\Persist.fl"; //First Type To Load The Persisted Object //If That Fails, Create A New One With Default Values. CWProductProtection.Initilize(); //(mFileName,0,"TestPackage",DateTime.Now,5,PeriodType.ACTIVATIONS); if (CWProductProtection.HasEvaluationPeriodExpired && !CWProductProtection.IsProductActivated) { MessageBox.Show("Your Trial Period Has Ended. Please Register Your Product.To Continue Use."); } Application.Run(new Form1()); }