Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    Dm.dmsoft dm = new Dm.dmsoft();
                }
                catch
                {
                    Func.RegCom("dm.dll");
                }
                mCode   = new Dm.dmsoft().GetMachineCode();
                regCode = Regedit.GetAppRegKey(RegistryDirName, "RegCode");
                if (string.IsNullOrEmpty(regCode) || !HardwareInfo.CheckCode(mCode, regCode, Form1.GameName))
                {
                    FrmReg r = new FrmReg();
                    if (DialogResult.OK != r.ShowDialog())
                    {
                        this.Close();
                        return;
                    }
                }

                foreach (string s in DTList)
                {
                    string[]     xlNpcs    = Directory.GetFiles(PicPath, "自动寻路_" + s + "_*.bmp");
                    List <XLNPC> xlNpcList = new List <XLNPC>();
                    foreach (string xl in xlNpcs)
                    {
                        XLNPC xlnpc = new XLNPC(xl.Replace(PicPath, ""), s + "_NPC_" + xl.Replace(PicPath + "自动寻路_" + s + "_", ""));
                        xlNpcList.Add(xlnpc);
                    }
                    if (xlNpcList.Count > 0)
                    {
                        DTNPC d = new DTNPC(s, xlNpcList);
                        dtNpcList.Add(d);
                    }
                }

                foreach (DTNPC dt in dtNpcList)
                {
                    if (!DTListEx.Contains(dt.DT))
                    {
                        this.cbxDT.Items.Add(dt);
                    }
                }
                this.txtDtStr.Text = Regedit.GetAppRegKey(RegistryDirName, "eyouMiMa");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                try
                {
                   Dm.dmsoft dm = new Dm.dmsoft();
                }
                catch
                {
                    Func.RegCom("dm.dll");
                }
                mCode = new Dm.dmsoft().GetMachineCode();
                regCode = Regedit.GetAppRegKey(RegistryDirName, "RegCode");
                if (string.IsNullOrEmpty(regCode) || !HardwareInfo.CheckCode(mCode, regCode, Form1.GameName))
                {
                    FrmReg r = new FrmReg();
                    if (DialogResult.OK != r.ShowDialog())
                    {
                        this.Close();
                        return;
                    }
                }

                foreach (string s in DTList)
                {
                    string[] xlNpcs = Directory.GetFiles(PicPath, "自动寻路_" + s + "_*.bmp");
                    List<XLNPC> xlNpcList = new List<XLNPC>();
                    foreach (string xl in xlNpcs)
                    {
                        XLNPC xlnpc = new XLNPC(xl.Replace(PicPath, ""), s + "_NPC_" + xl.Replace(PicPath + "自动寻路_" + s + "_", ""));
                        xlNpcList.Add(xlnpc);
                    }
                    if (xlNpcList.Count > 0)
                    {
                        DTNPC d = new DTNPC(s, xlNpcList);
                        dtNpcList.Add(d);
                    }
                }

                foreach (DTNPC dt in dtNpcList)
                {
                    if (!DTListEx.Contains(dt.DT))
                    {
                        this.cbxDT.Items.Add(dt);
                    }
                }
                this.txtDtStr.Text = Regedit.GetAppRegKey(RegistryDirName, "eyouMiMa");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }