Esempio n. 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            VerifyDialog verify = new VerifyDialog();

            if (verify.ShowDialog(this) == DialogResult.OK)
            {
                int verifyCode = Convert.ToInt32(verify.VerifyCode);

                if ((_template != null) && (_template.Size > 0))
                {
                    try
                    {
                        fingerPrint.IdentifyPrepare(_template);

                        IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);

                        IDataReader dataReader = dl.GetTemplate(verifyCode);
                        using (dataReader)
                        {
                            while (dataReader.Read())
                            {
                                int    tempId = Convert.ToInt32(dataReader["ID"]);
                                byte[] buff   = (byte[])dataReader["template"];

                                GriauleFingerprintLibrary.DataTypes.FingerprintTemplate testTemplate = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate();

                                testTemplate.Size   = buff.Length;
                                testTemplate.Buffer = buff;

                                int score;
                                if (Identify(testTemplate, out score))
                                {
//                                    WriteLog(string.Format("Fingerprint matched, ID:{0} - Score: {1}", tempId, score));

                                    DisplayImage(_template, true);

                                    return;
                                }
                            }
                            //                          WriteLog("Fingerprint not found.");
                        }
                    }
                    catch { }
                }
                else
                {
                    //                WriteLog("Must acquire a finger print image and extract a template, before verify within the database");
                }
            }
        }
Esempio n. 2
0
        public void Verificar()
        {
            VerifyDialog verify = new VerifyDialog();

            if (verify.ShowDialog(this) == DialogResult.OK)
            {
                int verifyCode = Convert.ToInt32(verify.VerifyCode);

                if ((_template != null) && (_template.Size > 0))
                {
                    try
                    {
                        fingerPrint.IdentifyPrepare(_template);


                        mEnroll dl = new mEnroll();
                        List <FingerprintTemplateDTO> lst = dl.GetTemplates();
                        //IDataReader dataReader = dl.GetTemplates();
                        foreach (var item in lst)
                        {
                            int    tempId  = item.ID;
                            byte[] buff    = item.Buffer;
                            int    quality = item.Quality;

                            GriauleFingerprintLibrary.DataTypes.FingerprintTemplate testTemplate = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate();

                            testTemplate.Size   = buff.Length;
                            testTemplate.Buffer = buff;

                            int score;
                            if (Identify(testTemplate, out score))
                            {
                                //WriteLog(string.Format("Fingerprint matched, ID:{0} - Score: {1}", tempId, score));
                                DisplayImage(_template, true);
                                return;
                            }
                            //                          WriteLog("Fingerprint not found.");
                        }
                    }
                    catch { }
                }
                else
                {
                    //                WriteLog("Must acquire a finger print image and extract a template, before verify within the database");
                }
            }
        }
Esempio n. 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            VerifyDialog verify = new VerifyDialog();
            if (verify.ShowDialog(this) == DialogResult.OK)
            {
                int verifyCode = Convert.ToInt32(verify.VerifyCode);

                if ((_template != null) && (_template.Size > 0)  )
                {
                    try
                    {
                        fingerPrint.IdentifyPrepare(_template);

                        IGRDal dl = DalFactory.GetDal(GrConnector.AccessDal);

                        IDataReader dataReader = dl.GetTemplate(verifyCode);
                        using (dataReader)
                        {
                            while (dataReader.Read())
                            {
                                int tempId = Convert.ToInt32(dataReader["ID"]);
                                byte[] buff = (byte[])dataReader["template"];

                                GriauleFingerprintLibrary.DataTypes.FingerprintTemplate testTemplate = new GriauleFingerprintLibrary.DataTypes.FingerprintTemplate();

                                testTemplate.Size = buff.Length;
                                testTemplate.Buffer = buff;

                                int score;
                                if (Identify(testTemplate, out score))
                                {
            //                                    WriteLog(string.Format("Fingerprint matched, ID:{0} - Score: {1}", tempId, score));

                                    DisplayImage(_template, true);

                                    return;
                                }
                            }
              //                          WriteLog("Fingerprint not found.");
                        }
                    }
                    catch { }
                }
                else
                {
            //                WriteLog("Must acquire a finger print image and extract a template, before verify within the database");
                }
            }
        }