public Form1()
 {
     InitializeComponent();
     Func.Log("InitializeComponent");
     FillDTListEx();
     BindCbxProcesses();
     DTNPC d1 = new DTNPC();
     DTList = new List<string>();
     string[] dtList = Directory.GetFiles(PicPath, "地图_*.bmp");
     foreach (string dt in dtList)
     {
         DTList.Add(dt.Replace(PicPath, "").Replace("地图_","").Replace(".bmp",""));
     }
     dtNpcList = new List<DTNPC>();
     //DTList.Add("百花谷");//
     //DTList.Add("程海");
     //DTList.Add("哀牢山");
     //DTList.Add("蓬莱");//
     //DTList.Add("嵩山");
     //DTList.Add("太子坡");//
     //DTList.Add("王屋山");
     //DTList.Add("五台山");//
     //DTList.Add("隐龙江");//
     for (int i = 1; i < 7; i++)
     {
         this.cbxSDIndex.Items.Add(i);
     }
     for (int i = 1; i < 9; i++)
     {
         this.cbxPlantIndex.Items.Add(i);
     }
     for (int i = 1; i < 7; i++)
     {
         this.cbxXYIndex.Items.Add(i);
     }
 }
        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);
            }
        }