public Form1() { try { InitializeComponent(); this.Text += " V:" + xVersion; NoFields = Convert.ToInt32(ConfigurationManager.AppSettings["NoFields"]); extrafeature = lic.CheckFeature("FeatureSet1") ; AdvancedFeature = lic.CheckFeature("AdvancedFeature") ; OCRFeature = lic.CheckFeature("OCRFeature"); lastFormField = Convert.ToInt32(ConfigurationManager.AppSettings["FormFields"].ToString()); btnAdvanced.Visible = AdvancedFeature; grpmearge.Visible = lic.CheckFeature("MergeFileFeature"); btnConvertMdbtoXl.Visible = lic.CheckFeature("ConvertToXls"); btnRandomizeDateTime.Visible = lic.CheckFeature("RandomizeDateTime"); dtpStartdate.Visible = lic.CheckFeature("RandomizeDateTime"); lbldatetime.Visible = lic.CheckFeature("RandomizeDateTime"); grpMdbChanges.Visible = lic.CheckFeature("RandomizeDateTime") || lic.CheckFeature("ConvertToXls"); //grpmearge.Visible = extrafeature; if (Convert.ToInt32(lic.GetProperties("OCRFeature")) < 2) { btnADSConvert.Visible = OCRFeature; } else { SharedValidators.ModifyRegistry Reg = new SharedValidators.ModifyRegistry(); btnADSConvert.Visible = (Reg.Read("OCRTRIED") == null); } ExtraFeatures feature = new ExtraFeatures(this); columnNames = feature.BuildColumnNames(); SharedValidators.Machine Machine = new SharedValidators.Machine(); string MachineKey = Machine.GetMachineIdentificationKey(); LicenceValidated = lic.ValidateCurrentKey(MachineKey); suped = lic.suped(); txtMessage.Text = Machine.GetDisplayMessage(MachineKey, lic); Rectangle resolution = Screen.PrimaryScreen.Bounds; this.Width = resolution.Width; this.Height = resolution.Height; this.MinimumSize = new System.Drawing.Size(this.Width, (this.Height * 97 / 100)); this.MaximumSize = new System.Drawing.Size(this.Width, (this.Height * 97 / 100)); ResizeCode(); pnlMain.Visible = true; pnlGrid.Visible = false; pnlMain.BringToFront(); chkAutoHighlight.Checked = false; chkAutoSave.Checked = false; txtMessage.Visible = !lic.isAdmin; plnAdminTools.Visible = lic.isAdmin; if (lic.isAdmin) { txtclientName.Text = lic.GetProperties("CustomerName"); txtMachines.Text = lic.GetProperties("NumberofMachines"); Licence.StringCipher cypher = new Licence.StringCipher(); for (int i = 1; i <= Convert.ToInt32(txtMachines.Text); i++) { string ekey = lic.GetProperties("Mkey" + i.ToString()); if (ekey != "") { string uekey = cypher.Decrypt(ekey, lic.cypherKey); ListViewItem lt = new ListViewItem(); lt.Text = "Mkey" + i.ToString(); lt.SubItems.Add(uekey); lt.SubItems.Add(ekey); lslLicences.Items.Add(lt); } } } pnlLeft.Enabled = LicenceValidated; pnlGrid.Enabled = LicenceValidated; lblInputdirectory.Text = ConfigurationManager.AppSettings["inputfolder"].ToString(); lblOutputdirectory.Text = ConfigurationManager.AppSettings["outputfolder"].ToString(); SharedValidators.Log.LogMessages(" Form constructor " + "done"); } catch (Exception e) { SharedValidators.Log.LogMessages("Error : Form constructor " + e.Message.ToString()); } }
private void btnADSConvert_Click_1(object sender, EventArgs e) { ConvertFiles convert = new ConvertFiles(this); convert.ConvertToADSViaMODI(lblInputdirectory.Text, lblOutputdirectory.Text); lblOutputdirectory_TextChanged(lblOutputdirectory, new EventArgs()); SharedValidators.ModifyRegistry reg = new SharedValidators.ModifyRegistry(); reg.Write("OCRTRIED", "ANGEL"); if (Convert.ToInt32(lic.GetProperties("OCRFeature")) < 2) { btnADSConvert.Visible = OCRFeature; } else { SharedValidators.ModifyRegistry Reg = new SharedValidators.ModifyRegistry(); btnADSConvert.Visible = (Reg.Read("OCRTRIED") == null); } }