Esempio n. 1
1
        public static bool Verify(DPFP.Sample _sample, DPFP.Template _template)
        {
            try
            {
                bool _result = false;
                DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = zsi.dtrs.Util.ExtractFeatures(_sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    // Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, _template, ref result);

                    if (result.Verified)
                    {
                        _result = true;
                    }
                    else
                    {
                        _result = false;
                    }
                }
                return(_result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            MakeReport("fingerprint captured.");
            SetPrompt("Scan fingerprint again");
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = "select RESIDENT_FINGERPRINT, RESIDENT.RESIDENT_ID,PROGRAM.PROGRAM_ID,LIST.RESIDENT_ID,LIST.PROGRAM_ID FROM RESIDENT LEFT JOIN LIST ON RESIDENT.RESIDENT_ID = LIST.RESIDENT_ID LEFT JOIN PROGRAM ON PROGRAM.PROGRAM_ID = RESIDENT.RESIDENT_ID WHERE LIST.PROGRAM_ID ='" + label2.Text + "' AND LIST_VERIFICATION IS NULL";
                cmd.Connection  = Connection.con;
                SqlDataAdapter sd = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                sd.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    byte[] _img = (byte[])dr["resident_fingerprint"];
                    string id   = dr["RESIDENT_ID"].ToString();
                    string pid  = dr["PROGRAM_ID"].ToString();



                    MemoryStream ms = new MemoryStream(_img);

                    DPFP.Template Template = new DPFP.Template();
                    Template.DeSerialize(ms);
                    DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();

                    Process(Sample);

                    DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                    if (features != null)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MessageBox.Show("Verified!!!");
                            SqlCommand cmds = new SqlCommand();
                            cmds.CommandText = "UPDATE LIST SET LIST_VERIFICATION ='True' WHERE LIST.RESIDENT_ID = '" + id.ToString() + "' AND LIST.PROGRAM_ID = '" + label2.Text + "'";
                            cmds.Connection  = Connection.con;
                            SqlDataReader dar = cmds.ExecuteReader();
                        }
                        else
                        {
                            MakeReport("Not registered as a resident!");
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
Esempio n. 3
0
 protected override void loadevents()
 {
     base.loadevents();
     base.Text   = "Fingerprint Verification";                           // editing for comment before
     Verificator = new DPFP.Verification.Verification();                 // Create a fingerprint template verificator
     UpdateStatus(0);
 }
Esempio n. 4
0
 protected override void Init()
 {
     base.Init();
     base.Text   = "Trying this huella thing";
     Verificator = new DPFP.Verification.Verification();
     UpdateStatus(0);
 }
Esempio n. 5
0
        void VerificationControl_OnComplete(object control, FeatureSet featureSet, ref DPFP.Gui.EventHandlerStatus eventHandlerStatus)
        {
            // Verify Here
            var ver             = new DPFP.Verification.Verification();
            var res             = new DPFP.Verification.Verification.Result();
            var fingerTemplates = new BeneficiaryRepository().GetFingerTemplates();

            // Compare feature set with all stored templates.


            foreach (var template in fingerTemplates)
            {
                // Get template from storage.
                if (template != null)
                {
                    // Compare feature set with particular template.
                    ver.Verify(featureSet, template, ref res);
                    //_data.IsFeatureSetMatched = res.Verified;
                    //_data.FalseAcceptRate = res.FARAchieved;
                    if (res.Verified)
                    {
                        break; // success
                    }
                }
            }

            if (!res.Verified)
            {
                eventHandlerStatus = DPFP.Gui.EventHandlerStatus.Failure;
            }

            //_data.Update();
        }
Esempio n. 6
0
        private void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            //save to the db
            const string filename = "biometricverification.sqlite";
            var          conn     = new SQLiteConnection("Data Source=" + filename + ";");

            try
            {
                conn.Open();
                using (var command = new SQLiteCommand("SELECT * FROM fingerprint WHERE fingerprint = @finger_print", conn))
                {
                    command.Parameters.Add("@finger_print", DbType.Binary).Value = FeatureSet.Bytes;
                    //command.Parameters.Add("@fingerD", DbType.Int16).Value = Finger;
                    SQLiteDataReader dataR = command.ExecuteReader();
                    if (dataR.HasRows)
                    {
                        verification_status_lbl.ForeColor = Color.Green;
                        verification_status_lbl.Text      = "VALID";
                    }
                    else
                    {
                        Status = DPFP.Gui.EventHandlerStatus.Failure;
                        verification_status_lbl.ForeColor = Color.Red;
                        verification_status_lbl.Text      = "INVALID";
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            // Compare feature set with all stored templates.
            //foreach (DPFP.Template template in Data.Templates)
            //{
            //    // Get template from storage.
            //    if (template != null)
            //    {
            //        // Compare feature set with particular template.
            //        ver.Verify(FeatureSet, template, ref res);
            //        Data.IsFeatureSetMatched = res.Verified;
            //        Data.FalseAcceptRate = res.FARAchieved;
            //        if (res.Verified)
            //            verification_status_lbl.ForeColor = Color.Green;
            //            verification_status_lbl.Text = "VALID";
            //            break; // success
            //    }
            //}
            //if (!res.Verified)
            //{
            //    Status = DPFP.Gui.EventHandlerStatus.Failure;
            //    verification_status_lbl.ForeColor = Color.Red;
            //    verification_status_lbl.Text = "INVALID";
            //}
            Thread.Sleep(TimeSpan.FromSeconds(3));
            verification_status_lbl.Text = "";
        }
Esempio n. 7
0
 protected void  Init()
 {
     Capturer = new DPFP.Capture.Capture();                        // Create a capture operation.
     Capturer.EventHandler = this;                                 // Subscribe for capturing events.
     Verificator           = new DPFP.Verification.Verification(); // Create a fingerprint template verificator
     //UpdateStatus(0);
 }
Esempio n. 8
0
 public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
 {
     DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
     DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();
     // Compare feature set with all stored templates.
     foreach (DPFP.Template template in Data.Templates)
     {
         // Get template from storage.
         if (template != null)
         {
             // Compare feature set with particular template.
             ver.Verify(FeatureSet, template, ref res);
             Data.IsFeatureSetMatched = res.Verified;
             Data.FalseAcceptRate     = res.FARAchieved;
             if (res.Verified)
             {
                 break; // success
             }
         }
     }
     if (!res.Verified)
     {
         Status = DPFP.Gui.EventHandlerStatus.Failure;
     }
     Data.Update();
 }
        //se inicializa el componente
        protected virtual void Init()
        {
            #region init
            try
            {
                Capturer = new DPFP.Capture.Capture();                          // Create a capture operation.

                if (null != Capturer)
                {
                    Capturer.EventHandler = this;                                       // Subscribe for capturing events.
                    capturado             = false;
                    identificado          = false;
                    Verificator           = new DPFP.Verification.Verification(); // Create a fingerprint template verificator
                    //SetStatus("Coloque su dedo en el lector para iniciar la Verificación");
                }
                else
                {
                    SetStatus("No se pudo inicializar la operacion de captura!");
                }
            }
            catch
            {
                SetStatus("No se pudo inicializar la operacion de captura!");
            }
            #endregion
        }
 private void Verification_FormClosed(object sender, FormClosedEventArgs e)
 {
     capteror = new DPFP.Capture.Capture();
     capteror.EventHandler = this;
     verifor = new DPFP.Verification.Verification();
     Stop();
 }
Esempio n. 11
0
        private void frmTransfer_Load(object sender, EventArgs e)
        {
            MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;

            materialSkinManager.ColorScheme = new ColorScheme(Primary.Green400, Primary.Green700,
                                                              Primary.Green100, Accent.LightGreen200, TextShade.WHITE);

            LLId = (int)((Land)Tag).PersonId;

            FileInfo file = new FileInfo(LLFPpath + "/" + LLId.ToString() + ".fpt");

            using (FileStream f = file.OpenRead())
            {
                Template fpt = new Template(f);
                Owners.Add(fpt);
            }

            file = new FileInfo(NoKFPpath + "/" + LLId.ToString() + ".fpt");

            using (FileStream f = file.OpenRead())
            {
                Template fpt = new Template(f);
                Owners.Add(fpt);
            }
            Verificator = new DPFP.Verification.Verification();
            Init();
            Start();
            action = "verify old owner";
        }
Esempio n. 12
0
        //private void UpdateStatus()
        //{
        //	// Show number of samples needed.
        //	SetStatus(String.Format("Fingerprint samples needed: {0}", Enroller.FeaturesNeeded));
        //}


        #endregion

        private void btnNextFP_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            DirectoryInfo dir = new DirectoryInfo(LLFPpath);

            direc = dir.GetFiles("*fpt");

            if (direc.Length < 1)
            {
                MessageBox.Show("No Landlord in the database. Add Landlord first.");
                return;
            }

            foreach (var file in direc)
            {
                using (FileStream f = file.OpenRead())
                {
                    Template fpt = new Template(f);
                    LLtemplates.Add(fpt);
                }
            }

            Verificator = new DPFP.Verification.Verification();
            Start();
            action = "verify new owner";

            animPan.HideSync(panFprint);
            animPan.ShowSync(panNew);

            Cursor = Cursors.Arrow;
        }
Esempio n. 13
0
 protected override void Init()
 {
     base.Init();
     base.Text   = "Verificación de Huella Digital";
     Verificator = new DPFP.Verification.Verification();     // Create a fingerprint template verificator
     UpdateStatus(0);
 }
Esempio n. 14
0
        public static bool Verify(DPFP.Sample _sample, DPFP.Template _template)
        {
            try
            {
                bool _result = false;
                DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();
                DPFP.FeatureSet features = zsi.dtrs.Util.ExtractFeatures(_sample, DPFP.Processing.DataPurpose.Verification);

                // Check quality of the sample and start verification if it's good
                // TODO: move to a separate task
                if (features != null)
                {
                    // Compare the feature set with our template
                    DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                    Verificator.Verify(features, _template, ref result);

                    if (result.Verified)
                        _result = true;
                    else
                        _result = false;

                }
                return _result;
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
Esempio n. 15
0
 protected override void Init()
 {
     base.Init();
     base.Text   = "Fingerprint Verification";
     Verificator = new DPFP.Verification.Verification();     // Create a fingerprint template verificator
     UpdateStatus(0);
 }
Esempio n. 16
0
        public void OnComplete(object Capture, string ReaderSerialNumber, DPFP.Sample Sample)
        {
            //Process(Sample);
            try
            {
                Connection con = new Connection();
                con.Connect();
                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = " select * from resident ";
                cmd.Connection  = Connection.con;
                SqlDataAdapter sd = new SqlDataAdapter(cmd);
                DataTable      dt = new DataTable();
                sd.Fill(dt);

                foreach (DataRow dr in dt.Rows)
                {
                    byte[] _img = (byte[])dr["resident_fingerprint"];
                    //string id = dr["RESIDENT_ID"].ToString();
                    MemoryStream  ms       = new MemoryStream(_img);
                    DPFP.Template Template = new DPFP.Template();
                    Template.DeSerialize(ms);
                    DPFP.Verification.Verification Verificator = new DPFP.Verification.Verification();

                    //  Process(Sample);

                    DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
                    if (features != null)
                    {
                        DPFP.Verification.Verification.Result result = new DPFP.Verification.Verification.Result();
                        Verificator.Verify(features, Template, ref result);
                        // UpdateStatus(result.FARAchieved);
                        if (result.Verified)
                        {
                            MessageBox.Show("This Resident is already Registered!!!");
                            Reset();
                            FMPIclear();
                            break;
                        }
                        else
                        {
                            MakeReport("fingerprint captured.");
                            SetPrompt("Scan fingerprint again");
                            Process(Sample);
                            if (scans.Text == "0 scans left")
                            {
                                cp.StopCapture();
                            }
                            break;
                        }
                    }
                    else
                    {
                    }
                }
            }
            catch
            {
            }
        }
Esempio n. 17
0
 protected override void Init()
 {
     base.Init();
     base.Text = "Fingerprint Verification Session";
     //TODO: Create a Fingerprint Template Verificator
     Verificator = new DPFP.Verification.Verification();
     UpdateStatus(0);
 }
Esempio n. 18
0
        public CompareWindow()
        {
            InitializeComponent();

            Init();

            Verificator = new DPFP.Verification.Verification();         // Create a fingerprint template verificator
        }
Esempio n. 19
0
 public tab_document()
 {
     InitializeComponent();
     Verificator        = new DPFP.Verification.Verification();
     textBox1.BackColor = Color.White;
     textBox2.BackColor = Color.White;
     Stop();
 }
Esempio n. 20
0
        protected virtual void Init(string serialFinger)
        {
            try
            {
                SetTextBox("Request Init", DateTime.Now);
                Stop();
                if (serialFinger != null)
                {
                    Capturer = new DPFP.Capture.Capture(serialFinger, DPFP.Capture.Priority.Low);                        // Create a capture operation.
                }
                else
                {
                    Capturer = new DPFP.Capture.Capture(DPFP.Capture.Priority.Low);
                }

                if (null != Capturer)
                {
                    Capturer.EventHandler = this;
                    notifyEvent           = new FingerArgs(ReaderSerialNumber, FingerArgs.FingerNotify.RN_FingerSucceedToInit, "Finger Initialized");
                    if (NotifyEvent != null)
                    {
                        SetTextBox("Finger Initialized", DateTime.Now);// Subscribe for capturing events.
                        NotifyEvent(this, notifyEvent);
                    }
                }
                else
                {
                    notifyEvent = new FingerArgs(ReaderSerialNumber, FingerArgs.FingerNotify.RN_FingerFailedToInit, "Finger failed to Initialize");
                    if (NotifyEvent != null)
                    {
                        SetTextBox("Can't initiate capture operation!", DateTime.Now);
                        NotifyEvent(this, notifyEvent);
                    }
                }
            }
            catch
            {
                notifyEvent = new FingerArgs(ReaderSerialNumber, FingerArgs.FingerNotify.RN_FingerFailedToInit, "Finger failed to Initialize");
                if (NotifyEvent != null)
                {
                    SetTextBox("Finger failed to Initialize", DateTime.Now);
                    NotifyEvent(this, notifyEvent);
                }
            }
            if (Mode == FingerprintMode.Verify)
            {
                Verificator = new DPFP.Verification.Verification(FarThreshold);         // Create a fingerprint template verificator FAR 0.01% > 214748
                SetTextBox("Init Verificator with FAR : " + Verificator.FARRequested.ToString(), DateTime.Now);
                if (bUseEmbedDB)
                {
                    #if UseSQLITE
                    DBClassUser dbJob = new DBClassUser(UserList);
                    dbJob.RecoverUser();
                    #endif
                }
            }
        }
Esempio n. 21
0
 public frmBaterPonto(AppDataContext con)
 {
     InitializeComponent();
     context     = con;
     funcionario = new Funcionario();
     cp          = new DPFP.Capture.Capture();
     cp.StartCapture();
     cp.EventHandler = this;
     Verificator     = new DPFP.Verification.Verification();
 }
Esempio n. 22
0
        public Verification()
        {
            InitializeComponent();

            Init();

            isVerified = false;

            Verificator = new DPFP.Verification.Verification();         // Create a fingerprint template verificator
        }
Esempio n. 23
0
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            foreach (Staff dt in tempstorage.TempStaffs)
            {
                // Compare feature set with all stored templates.
                foreach (DPFP.Template template in dt.Templates)
                {
                    // Get template from storage.
                    if (template != null)
                    {
                        // Compare feature set with particular template.
                        ver.Verify(FeatureSet, template, ref res);
                        //dt.IsFeatureSetMatched = res.Verified;
                        //dt.FalseAcceptRate = res.FARAchieved;
                        if (res.Verified)
                        {
                            //search for the staff attendance that day
                            Attendance attdance = tempstorage.TempAttendance.Find(x => x.AdminId == tempstorage.TempStaffs.IndexOf(dt).ToString() && x.AttendanceDate == DateTime.Today.Date.ToShortDateString());

                            if (attdance != null)
                            {
                                MessageBox.Show("Attendance already taken for the day.");
                            }
                            else
                            {
                                //keep a spot for attendance
                                Attendance attd = new Attendance();
                                attd.AdminName      = dt.FirstName + " " + dt.LastName;
                                attd.AdminId        = tempstorage.TempStaffs.IndexOf(dt).ToString();
                                attd.AttendanceDate = DateTime.Today.Date.ToShortDateString();
                                attd.TimeIn         = DateTime.Now.TimeOfDay.ToString();
                                tempstorage.TempAttendance.Add(attd);
                                ListEvents.Items.Insert(0, String.Format("Attendance taken for staff: {0}, Time In: {1}, Date: {2}", attd.AdminName, attd.TimeIn, attd.AttendanceDate));
                            }

                            break; // success
                        }
                    }
                }
                if (res.Verified)
                {
                    break; // success
                }
            }



            if (!res.Verified)
            {
                Status = DPFP.Gui.EventHandlerStatus.Failure;
            }
        }
        private void FrmAttendance_Load(object sender, EventArgs e)
        {
            try
            {
                activeSemester = _semesterRepo.GetActiveSessionSemester();
                if (activeSemester == null)
                {
                    MessageBox.Show("You cannot mark attendance because there is no active semester", "Denied", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                lblSession.Text = activeSemester.Session + " - " + activeSemester.Semester;
                Cursor          = Cursors.WaitCursor;
                // set culture
                Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB", false);

                Capturer = new DPFP.Capture.Capture();               // Create a capture operation.
                try
                {
                    if ((Capturer != null))
                    {
                        Capturer.StartCapture();
                        Capturer.EventHandler = this;
                    }
                    // Subscribe for capturing events.
                    else
                    {
                        throw new Exception("Can't initiate capture operation! Please exit and relaunch the application");
                    }
                }
                catch (Exception ex)
                {
                    logger.WriteLog(ex);
                    MessageBox.Show("Can't initiate capture operation! Please exit and relaunch the application", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                Enroller    = new DPFP.Processing.Enrollment();
                Verificator = new DPFP.Verification.Verification();
                Application.DoEvents();

                Capturer.StartCapture();
                SetPrompt("Using the fingerprint reader, scan your fingerprint.");
            }
            catch (Exception ex)
            {
                logger.WriteLog(ex);
                //MsgBox(ex.Message, MsgBoxStyle.Exclamation, Application.ProductName);
            }
            finally
            {
                Cursor = Cursors.Default;
            }

            getTodayAttendance();
        }
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification        ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            try
            {
                string mem = null;
                con.Open();
                SqlCommand    cmd      = new SqlCommand("select memName,finger from familyMembers where CardNo='" + CardNo + "'", con);
                SqlDataReader dr       = cmd.ExecuteReader();
                DPFP.Template template = new DPFP.Template();
                while (dr.Read())
                {
                    mem = dr["memName"].ToString();
                    byte[] tmp = (byte[])dr["finger"];
                    template.DeSerialize(tmp);

                    if (template != null)
                    {
                        ver.Verify(FeatureSet, template, ref res);
                        Data.IsFeatureSetMatched = res.Verified;
                        Data.FalseAcceptRate     = res.FARAchieved;
                        string rate = Data.FalseAcceptRate.ToString() + "00";
                        string sp   = rate.Remove(2);
                        label1.Text = sp + " %";
                        if (sp == "00")
                        {
                            label1.Text = "100 %";
                        }

                        if (res.Verified)
                        {
                            MessageBox.Show("Verification Success");
                            con.Close();
                            UserLogin.member = mem;
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                con.Close();
            }

            //if (!res.Verified)
            //    Status = DPFP.Gui.EventHandlerStatus.Failure;
            //MessageBox.Show("Unauthorized User");
            Data.Update();
        }
Esempio n. 26
0
        private void Prueba_Huella_Load(object sender, EventArgs e)
        {
            this.Init();
            this.Start();

            Verificator = new DPFP.Verification.Verification();

            List_Usuarios = (from cliente in contexto.Catalogo_Clientes select new csCliente()
            {
                id_Cliente = cliente.id_cliente, fingerPrint = cliente.huella
            }).ToList <csCliente>();
        }
Esempio n. 27
0
        private void Verify_Load(object sender, EventArgs e)
        {
            this.Init();
            this.Start();

            this.Text   = "Fingerprint Verification";
            Verificator = new DPFP.Verification.Verification();

            List_Usuarios = (from cliente in contexto.tb_Usuarios select new csCliente()
            {
                id_Cliente = cliente.id_usuario, fingerPrint = cliente.dedo
            }).ToList <csCliente>();
        }
Esempio n. 28
0
 public SetFingerprint()
 {
     try
     {
         InitializeComponent();
         Enroller    = new DPFP.Processing.Enrollment();
         Verificator = new DPFP.Verification.Verification();
         InitDatabase();
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "OTC", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 29
0
 protected virtual void Init()
 {
     try
     {
         Capturer    = new DPFP.Capture.Capture();
         Verificator = new DPFP.Verification.Verification();
         if (null != Capturer)
         {
             Capturer.EventHandler = this;
         }
     }
     catch
     {
         MessageBox.Show("Can't initiate capture");
     }
 }
Esempio n. 30
0
 public Form2()
 {
     InitializeComponent();
     graphics = this.CreateGraphics();
     font     = new Font("Times New Roman", 12, FontStyle.Bold, GraphicsUnit.Pixel);
     DPFP.Capture.ReadersCollection coll = new
                                           DPFP.Capture.ReadersCollection();
     regFeatures = new DPFP.FeatureSet[4];
     for (int i = 0; i < 4; i++)
     {
         regFeatures[i] = new DPFP.FeatureSet();
     }
     verFeatures       = new DPFP.FeatureSet();
     createRegTemplate = new DPFP.Processing.Enrollment();
     readers           = new DPFP.Capture.ReadersCollection();
     for (int i = 0; i < readers.Count; i++)
     {
         readerDescription = readers[i];
         if ((readerDescription.Vendor == "Digital Persona, Inc.") ||
             (readerDescription.Vendor == "DigitalPersona, Inc."))
         {
             try
             {
                 capturer = new
                            DPFP.Capture.Capture(readerDescription.SerialNumber,
                                                 DPFP.Capture.Priority.Normal);//CREAMOS UNA OPERACION DE CAPTURAS.
             }
             catch (Exception ex)
             {
                 MessageBox.Show(ex.Message);
             }
             capturer.EventHandler = this; //AQUI CAPTURAMOS LOS EVENTOS.
             converter             = new DPFP.Capture.SampleConversion();
             try
             {
                 verify = new DPFP.Verification.Verification();
             }
             catch (Exception ex)
             {
                 MessageBox.Show("Ex: " + ex.ToString());
             }
             break;
         }
     }
 }
Esempio n. 31
0
 public void OnComplete(object Capture, string ReaderSerialNumber, Sample Sample)
 {
     DPFP.Verification.Verification        Ver = new DPFP.Verification.Verification();
     DPFP.Verification.Verification.Result Res = new DPFP.Verification.Verification.Result();
     DPFP.FeatureSet features = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Verification);
     foreach (AppData Te in Temp)
     {
         if (Te != null)
         {
             Ver.Verify(features, Te.Template, ref Res);
             if (Res.Verified)
             {
                 MessageBox.Show(String.Format("Se encontro la huella en el usuario {0}", Te.IDCliente));
                 break; // se encontro
             }
         }
     }
 }
 public UILogin()
 {
     InitializeComponent();
     
     UIFinger_Printer.Foreground = new SolidColorBrush(Colors.White);
     Verificator = new DPFP.Verification.Verification();
     try
     {
         Capturer = new DPFP.Capture.Capture();				// Create a capture operation.
         if (null != Capturer)
             Capturer.EventHandler = this;					// Subscribe for capturing events.
        
     }
     catch
     {
        
     }
    
 }
        public UIUserEdit()
        {
            InitializeComponent();
            UIFinger_Printer.Foreground = new SolidColorBrush(Colors.Black);
            foreach(Code.User.UserTypeData type in App.TypeUsers)
            {
                UITypeUser.Items.Add(type);
            }
            Verificator = new DPFP.Verification.Verification();
            try
            {
                Capturer = new DPFP.Capture.Capture();				// Create a capture operation.
                if (null != Capturer)
                    Capturer.EventHandler = this;					// Subscribe for capturing events.

            }
            catch
            {

            }
        }
    public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status) {
      DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
      DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

      // Compare feature set with all stored templates.
      foreach (DPFP.Template template in Data.Templates) {
        // Get template from storage.
        if (template != null) {
          // Compare feature set with particular template.
          ver.Verify(FeatureSet, template, ref res);
          Data.IsFeatureSetMatched = res.Verified;
          Data.FalseAcceptRate = res.FARAchieved;
          if (res.Verified)
            break; // success
        }
      }

      if (!res.Verified)
        Status = DPFP.Gui.EventHandlerStatus.Failure;

      Data.Update();
    }
Esempio n. 35
0
 public ValidarUsuario()
 {
     InitializeComponent();
     Verificator = new DPFP.Verification.Verification();
 }
        public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status)
        {
            DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
            DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            //string conStr = "Data Source=.; Initial Catalog=Registration; Integrated Security=true";

            //SqlConnection con = new SqlConnection(conStr);
            //SqlCommand cmd = new SqlCommand("Select FingerPrintData from FingerPrints where Id = 11", con);

            //con.Open();

            //byte[] userFingerPrintData = new byte[0];

            //using (con)
            //{
            //    userFingerPrintData = cmd.ExecuteScalar() as byte[];
            //}

            //byte[] fingerPrintCode = new StudentDAC().GetFingerCodeById(2);

            List<Guardian> guardians = new GuardianDAC().SelectAllGuardians();
           
            if (guardians != null && guardians.Count > 0)
            {
                foreach (var item in guardians)
                {
                    ver = new DPFP.Verification.Verification();
                    res = new DPFP.Verification.Verification.Result();
                    DPFP.Template temp = new DPFP.Template();

                    if (item.FingerCode != null)
                    {
                        temp.DeSerialize(item.FingerCode);

                        if (temp != null)
                        {
                            // Compare feature set with particular template.

                            ver.Verify(FeatureSet, temp, ref res);

                            if (res.Verified)
                            {
                                guardiansTakeAwayForm.guardian = item;

                                this.Close();
                                break;
                            }
                        }
                    }
                    
                }
            }

            
            
            if (!res.Verified)
                Status = DPFP.Gui.EventHandlerStatus.Failure;

        }
    public void OnComplete(object Control, DPFP.FeatureSet FeatureSet, ref DPFP.Gui.EventHandlerStatus Status) {
      DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
      DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();

            string conStr = "Data Source=.; Initial Catalog=Registration; Integrated Security=true";

            SqlConnection con = new SqlConnection(conStr);
            SqlCommand cmd = new SqlCommand("Select FingerPrintData from FingerPrints where Id = 6", con);

            con.Open();

            byte[] userFingerPrintData = new byte[0];

            using (con)
            {
                userFingerPrintData = cmd.ExecuteScalar() as byte[];
            }

            DPFP.Template temp = new DPFP.Template();
            temp.DeSerialize(userFingerPrintData);

            if (temp != null)
            {
                // Compare feature set with particular template.

                ver.Verify(FeatureSet, temp, ref res);
                Data.IsFeatureSetMatched = res.Verified;
                Data.FalseAcceptRate = res.FARAchieved;
            }


            // Compare feature set with all stored templates.
            foreach (DPFP.Template template in Data.Templates) {
        // Get template from storage.
        //if (template != null) {
        //  // Compare feature set with particular template.
          
        //  ver.Verify(FeatureSet, template, ref res);
        //  Data.IsFeatureSetMatched = res.Verified;
        //  Data.FalseAcceptRate = res.FARAchieved;
        //  if (res.Verified)
        //    break; // success
        //}
      }

      if (!res.Verified)
        Status = DPFP.Gui.EventHandlerStatus.Failure;

      Data.Update();
    }