private void ICDR_EDGE_Load(object sender, EventArgs e) { //加密模块开始 appPath = Application.StartupPath.ToString (); string licPath = appPath + "\\LAY3-T.lic"; LAY3_R.frmRegister form = new LAY3_R.frmRegister(); if (!File.Exists(licPath)) { form.ShowDialog(); if (!File.Exists(licPath)) { this.Close(); return; } } //加密模块检查序列号 StreamReader reader = new StreamReader(licPath, System.Text.Encoding.GetEncoding("utf-8")); serialNum = reader.ReadLine(); machineNum = reader.ReadLine(); regNum = reader.ReadLine(); reader.Close(); if (!CheckRegHead(machineNum, regNum)) { //这儿会对序列号正确性做简单校验,不合格的会有提示。以后再校验出问题就判定为恶意破解,不再有提示,直接修改系统运行结果。 MessageBox.Show("序列号不正确,系统将退出,请与软件供应商联系!"); this.Close(); } else { this.WindowState = FormWindowState.Maximized; } //加载ACCESS Acc.Init(serialNum, appPath + "\\iCDR.accdb", serialNum, serialNum); Acc.Open(); ////加载XML //XmlDocument doc = new XmlDocument(); //doc.Load(appPath + "\\CongfigSql.xml"); //var node = doc.DocumentElement.SelectSingleNode("//Variable"); //string attributeValue = node.Attributes(0).Value; //加载XML到TREE XmlDocument document = new XmlDocument(); //document.Load(appPath + "\\CdrAppTreeSql.xml"); //ICDR.ModXml.populateTreeControl(document.DocumentElement, TreeView1.Nodes); //TreeView1.ExpandAll(); //初始化窗口展开 RadioButton1.Checked = true ; RadioButton7.Checked = true ; RadioButton9.Checked = true ; this.WindowState = FormWindowState.Maximized; }
private void ICDR_EDGE_Load(object sender, EventArgs e) { //加密模块开始 appPath = Application.StartupPath.ToString (); string licPath = appPath + "\\LAY3-T.lic"; LAY3_R.frmRegister form = new LAY3_R.frmRegister(); if (!File.Exists(licPath)) { form.ShowDialog(); if (!File.Exists(licPath)) { this.Close(); return; } } //加密模块检查序列号 //StreamReader reader = new StreamReader(licPath, System.Text.Encoding.GetEncoding("utf-8")); //serialNum = reader.ReadLine(); //machineNum = reader.ReadLine(); //regNum = reader.ReadLine(); //reader.Close(); //if (!CheckRegHead(machineNum, regNum)) //{ // //这儿会对序列号正确性做简单校验,不合格的会有提示。以后再校验出问题就判定为恶意破解,不再有提示,直接修改系统运行结果。 // MessageBox.Show("序列号不正确,系统将退出,请与软件供应商联系!"); // this.Close(); //} //else //{ // this.WindowState = FormWindowState.Maximized; // toolStripTextBox3.Text = "select top 100 * from sgsnpdp"; //} //加载ACCESS Acc.Init(serialNum, appPath + "\\iCDR.accdb", serialNum, serialNum); Acc.Open(); //加载XML到TREE LoadTree(); RadioButton1.Checked = true ; RadioButton7.Checked = true ; RadioButton9.Checked = true ; this.WindowState = FormWindowState.Maximized; }