Example #1
0
 private void DoCapture()
 {
     while (!bIsTimeToDie)
     {
         cbCapTmp = 2048;
         int ret = fpInstance.AcquireFingerprint(FPBuffer, CapTmp, ref cbCapTmp);
         if (ret == zkfp.ZKFP_ERR_OK)
         {
             SendMessage(FormHandle, MESSAGE_CAPTURED_OK, IntPtr.Zero, IntPtr.Zero);
         }
         Thread.Sleep(200);
     }
 }
Example #2
0
        public EventTransItem DoCapture()
        {
            EventTransItem result = new EventTransItem();

            result.result = 0;
            if (SensorStates > 0)
            {
                cbCapTmp = 2048;

                int ret = 0;
                ret = fpInstance.AcquireFingerprint(FPBuffer, CapTmp, ref cbCapTmp);
                if (ret == zkfp.ZKFP_ERR_OK)
                {
                    result = OnFingerGet();
                }
            }
            return(result);
        }
Example #3
0
        // [ CAPTURE FINGERPRINT ]
        private void DoCapture()
        {
            try
            {
                while (!bIsTimeToDie)
                {
                    cbCapTmp = 2048;
                    int ret = fpInstance.AcquireFingerprint(FPBuffer, CapTmp, ref cbCapTmp);

                    if (ret == zkfp.ZKFP_ERR_OK)
                    {
                        //if (RegisterCount == 0)
                        //    btnEnroll.Invoke((Action)delegate
                        //    {
                        //        btnEnroll.Enabled = true;
                        //    });
                        SendMessage(FormHandle, MESSAGE_CAPTURED_OK, IntPtr.Zero, IntPtr.Zero);
                    }
                    Thread.Sleep(100);
                }
            }
            catch { }
        }
Example #4
0
        static public void DoCapture()
        {
            try
            {
                while (!bIsTimeToDie)
                {
                    int ret = fpInstance.AcquireFingerprint(FPBuffer, CapTmp, ref cbCapTmp);

                    if (ret == zkfp.ZKFP_ERR_OK)
                    {
                        Array.Copy(CapTmp, RegTmps[RegisterCount], cbCapTmp);
                        RegisterCount++;

                        if (RegisterCount >= REGISTER_FINGER_COUNT)
                        {
                            RegisterCount = 0;
                            ret           = GenerateRegisteredFingerPrint();
                            if (zkfp.ZKFP_ERR_OK == ret)
                            {
                                ret = fpInstance.AddRegTemplate(iFid, RegTmp);
                                if (zkfp.ZKFP_ERR_OK == ret)
                                {
                                    string sql;
                                    zkfp.Blob2Base64String(RegTmp, regTempLen, ref fingerPrintTemplate);

                                    OracleConnection conn = new OracleConnection(String.Format("Data Source=Neptune; User Id={0}; Password={1}", TestConnection.oracelUser, TestConnection.oracelPass));
                                    conn.Open();

                                    if (FingerTap == 0)
                                    {
                                        OracleCommand     cmd   = new OracleCommand("SELECT f_id, u_id FROM user_t", conn);
                                        OracleDataAdapter da    = new OracleDataAdapter(cmd);
                                        DataTable         dt    = new DataTable();
                                        string            text1 = string.Empty;
                                        da.Fill(dt);
                                        conn.Close();
                                        foundUserid = 0;
                                        foreach (DataRow dr in dt.Rows)
                                        {
                                            text1  = Convert.ToString(dr["f_id"]);
                                            CapTmp = new byte[2048];
                                            CapTmp = zkfp.Base64String2Blob(text1);

                                            ret = fpInstance.Match(RegTmp, CapTmp);
                                            if (0 < ret)
                                            {
                                                userid      = Convert.ToString(dr["u_id"]);
                                                foundUserid = 1;
                                            }
                                        }
                                        if (foundUserid == 0)
                                        {
                                            DisconnectDevice();
                                            connect();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex) {
                DeviceConnected = 0;
            }
        }