private void bn_maintain_Click(object sender, EventArgs e)
        {
            Openstate = 0;
            Maintain ma = new Maintain();

            ma.Show();
            this.Visible = false;
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            Openstate = 1;
            //this.Icon. = false;
            //this.ShowIcon = false;
            String currentpath;

            currentpath      = System.IO.Directory.GetCurrentDirectory();
            this.tb_msg.Text = currentpath;

            Maintain ma = new Maintain();

            ma.MdiParent = this;

            OrderTest ot = new OrderTest();

            ot.MdiParent = this;


            #region
            ////串口启动
            ////thread = new Thread(CrossThreadFlush);
            ////thread.IsBackground = true;
            ////thread.Start();
            //int[] bit = new int[2];
            //bit[0] = 9600;
            //bit[1] = 115200;
            //foreach (var item in bit)
            //{
            //    this.cb_bit.Items.Add(item);
            //}
            //this.cb_bit.SelectedItem = bit[0];
            //string[] ports = SerialPort.GetPortNames();
            //foreach (var item in ports)
            //{
            //    this.cb_duankou.Items.Add(item);
            //}
            //cb_duankou.SelectedItem = ports[0];

            //this.ShowInTaskbar = false;

            //string jiaoyan = "NONE,ODD,EVEN,MARK,SPACE";
            //string[] jystr = jiaoyan.Split(',');
            //foreach (var item in jystr)
            //{
            //    cb_jiaoyan.Items.Add(item);
            //}
            //cb_jiaoyan.SelectedItem = jystr[0];



            //string shuju = "5,6,7,8";
            //string[] sjstr = shuju.Split(',');
            //foreach (var item in sjstr)
            //{
            //    cb_shuju.Items.Add(item);
            //}
            //cb_shuju.SelectedItem = sjstr[0];

            //string stop = "1,1.5,2";
            //string[] stopstr = stop.Split(',');
            //foreach (var item in stopstr)
            //{
            //    cb_stop.Items.Add(item);
            //}
            //cb_stop.SelectedItem = stopstr[0];

            #endregion

            //任务栏显示窗体
            this.ShowInTaskbar = false;
            ++DBHLper.count;
            if (DBHLper.count < 2)
            {
                this.myIcon.Visible = true;
            }
            else
            {
                this.myIcon.Visible = false;
            }
            //var options = new MqttServerOptions();
            //var mqttServer = new MqttServerFactory().CreateMqttServer(options);
        }