Esempio n. 1
0
        private void Main_Load(object sender, EventArgs e)
        {
            //显示系统当前时间
            SYS_TIME.Start();
            //设置皮肤
            skinEngine1.SkinFile = Application.StartupPath + @"\RealOne.ssk";

            //跨进程调用控件
            Control.CheckForIllegalCrossThreadCalls = false;
            //开启panel双缓冲
            panel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(panel1, true, null);
            //读取配置文件,判断程序是否是第一次启动
            bool isFirstRun = bool.Parse(ConfigurationManager.AppSettings["first_run"]);

            if (isFirstRun)
            {
                SettingIP st = new SettingIP();
                st.ShowDialog();
            }
            //检测与远程服务器以及枪柜的联网状态
            WebService_Status.RunWorkerAsync();
            //查询柜子状态
            gunark_status.Start();
            //打开枪串口
            comm.OpenPort_gun("COM" + Port.Get_ComGun());
            //打开弹串口
            comm.OpenPort_bullet("COM" + Port.Get_ComBullet());
            //打开指纹串口
            p.OpenPort();
            //打开酒精串口
            alcohol.OpenPort("COM" + Port.Get_ComDrink());
        }
Esempio n. 2
0
        private void Main_Load(object sender, EventArgs e)
        {
            //显示系统当前时间
            SYS_TIME.Start();
            //设置皮肤
            skinEngine1.SkinFile = Application.StartupPath + @"\RealOne.ssk";

            //跨进程调用控件
            Control.CheckForIllegalCrossThreadCalls = false;
            //开启panel双缓冲
            panel1.GetType().GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(panel1, true, null);
            //读取配置文件,判断程序是否是第一次启动
            bool isFirstRun = bool.Parse(ConfigurationManager.AppSettings["first_run"]);
            if (isFirstRun)
            {
                SettingIP st = new SettingIP();
                st.ShowDialog();
            }
            //检测与远程服务器以及枪柜的联网状态
            WebService_Status.RunWorkerAsync();
            //查询柜子状态
            gunark_status.Start();
            //打开枪串口
            comm.OpenPort_gun("COM"+Port.Get_ComGun());
            //打开弹串口
            comm.OpenPort_bullet("COM"+Port.Get_ComBullet());
            //打开指纹串口
            p.OpenPort();
            //打开酒精串口
            alcohol.OpenPort("COM"+Port.Get_ComDrink());
        }