Exemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (DetectVirus.DetectXXX() || DetectVirus.DetectGuanjia())
            {
                MessageBox.Show(this, "zkprintcenter 被木马软件干扰,无法启动");
                Application.Exit();
                return;
            }

            AddShortcutToStartupGroup("dp2-中控指纹阅读器接口");

            StartRemotingServer();

            this.checkBox_beep.Checked      = Properties.Settings.Default.Beep;
            this.checkBox_speak.Checked     = Properties.Settings.Default.Speak;
            this.m_bDisplayFingerprintImage = Properties.Settings.Default.DisplayFingerprintImage;
            this.m_nThreshold = Properties.Settings.Default.Threshold;

            /*
             * this.checkBox_autoStart.Checked = Properties.Settings.Default.AutoStart;
             * if (this.checkBox_autoStart.Checked == true)
             *  this.button_begin_Click(null, null);
             */
            OpenServer();
        }
Exemplo n.º 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            if (DetectVirus.Detect360() || DetectVirus.DetectGuanjia())
            {
                MessageBox.Show("dp2SSL 被木马软件干扰,无法启动");
                System.Windows.Application.Current.Shutdown();
                return;
            }

            WpfClientInfo.TypeOfProgram = typeof(App);
            if (StringUtil.IsDevelopMode() == false)
            {
                WpfClientInfo.PrepareCatchException();
            }

            WpfClientInfo.Initial("dp2SSL");
            base.OnStartup(e);

            this._channelPool.BeforeLogin += new DigitalPlatform.LibraryClient.BeforeLoginEventHandle(Channel_BeforeLogin);
            this._channelPool.AfterLogin  += new AfterLoginEventHandle(Channel_AfterLogin);

            // 后台自动检查更新
            Task.Run(() =>
            {
                NormalResult result = WpfClientInfo.InstallUpdateSync();
                if (result.Value == -1)
                {
                    OutputHistory("自动更新出错: " + result.ErrorInfo, 2);
                }
                else if (result.Value == 1)
                {
                    OutputHistory(result.ErrorInfo, 1);
                }
                else if (string.IsNullOrEmpty(result.ErrorInfo) == false)
                {
                    OutputHistory(result.ErrorInfo, 0);
                }
            });
        }
Exemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (DetectVirus.Detect360() || DetectVirus.DetectGuanjia())
            {
                MessageBox.Show(this, "rfidcenter 被木马软件干扰,无法启动");
                Application.Exit();
                return;
            }

            ClientInfo.Initial("rfidcenter");

            ClearHtml();

            // 显示版本号
            this.OutputHistory($"版本号: {ClientInfo.ClientVersion}");

            if (StartRemotingServer() == false)
            {
                return;
            }

            // "ipc://RfidChannel/RfidServer"
            // 通道打开成功后,窗口应该显示成一种特定的状态
            int nRet = StartChannel(
                "ipc://RfidChannel/RfidServer",
                out string strError);

            if (nRet == -1)
            {
                this.ShowMessage(strError, "red", true);
                return;
            }

            Task.Run(() =>
            {
                InitializeDriver();
            });

            if (StringUtil.IsDevelopMode() == false)
            {
                MenuItem_testing.Visible = false;
                this.toolStripButton_autoInventory.Visible = false;
            }

            // 后台自动检查更新
            Task.Run(() =>
            {
                NormalResult result = ClientInfo.InstallUpdateSync();
                if (result.Value == -1)
                {
                    OutputHistory("自动更新出错: " + result.ErrorInfo, 2);
                }
                else if (result.Value == 1)
                {
                    OutputHistory(result.ErrorInfo, 1);
                }
                else if (string.IsNullOrEmpty(result.ErrorInfo) == false)
                {
                    OutputHistory(result.ErrorInfo, 0);
                }
            });
        }