Exemplo n.º 1
0
 /// <summary>
 /// 开始指纹检测
 /// </summary>
 public void StartCheck()
 {
     GrossCheck = false;
     if (GetFinger(1) == 1)
     {
         if (FingerCheckCount == 2)
         {
             finger = commonDao.SelfDber.Entities <CmcsFinger>("where UserId!=:UserId", new { UserId = SelfVars.LoginUser.PartyId });
         }
         foreach (CmcsFinger item in finger)
         {
             Fingerdll.ZAZDownCharFromFile(hHandle, nDevAddr, 2, item.FingerUrl);
             int[] nScore = new int[1];
             ret = Fingerdll.ZAZMatch(hHandle, nDevAddr, nScore);                      //比对模板
             if (nScore[0] > 50)
             {
                 if (FingerCheckCount == 1)
                 {
                     ShowToolTip("匹配成功,监督人进行指纹验证");
                     SelfVars.LoginUser = user;
                     GrossCheck         = true;
                     FingerCheckCount   = 2;
                     break;
                 }
                 else if (FingerCheckCount == 2)
                 {
                     SelfVars.LoginUser2 = commonDao.SelfDber.Get <User>(item.UserId);
                     if (SelfVars.LoginUser2.UserName == SelfVars.LoginUser.UserName)
                     {
                         ShowToolTip("指纹不能与登录人一样");
                         break;
                     }
                     GrossCheck = true;
                     taskSimpleScheduler.Cancal();
                     InvokeEx(() =>
                     {
                         if (GrossCheck)
                         {
                             ShowToolTip("指纹匹配成功...");
                             LoginSuccess();
                         }
                     });
                     break;
                 }
             }
         }
         if (!GrossCheck)
         {
             ShowToolTip("指纹不匹配...");
         }
     }
 }
Exemplo n.º 2
0
        private void btnRegsit_Click(object sender, EventArgs e)
        {
            int number = 0;

            try
            {
                number = int.Parse(txtFingerNumber.Text);
            }
            catch (Exception)
            {
            }
            taskSimpleScheduler.StartNewTask("注册指纹", () =>
            {
                if (finger.RegistFinger(number))
                {
                    taskSimpleScheduler.Cancal();
                }
                InvokeEx(() =>
                {
                    this.txtMessage.Text = finger.MessageStr;
                });
            }, 1000);

            finger.RegistFinger(number);
            if (finger.CurrentImage != null)
            {
                this.picFinger.Image = finger.CurrentImage;
            }
        }
Exemplo n.º 3
0
 private void FrmWin_FormClosed(object sender, FormClosedEventArgs e)
 {
     taskSimpleScheduler.Cancal();
 }
Exemplo n.º 4
0
 private void Form1_FormClosing(object sender, FormClosingEventArgs e)
 {
     taskSimpleScheduler.Cancal();
 }
Exemplo n.º 5
0
 /// <summary>
 /// 停止模拟
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnEnd_Click(object sender, EventArgs e)
 {
     isInsertData = false;
     taskSimpleScheduler.Cancal();
 }