Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
i have digital persona device version U.are.U5100.
we are using in c# with sdk, its generate a unique code every thumb impression.
i am saving unique code in sql server but how to fetch with this code.
because its give every time new unique code.

C#
private void OnCaptured(CaptureResult captureResult)
        {
            try
            {
                // Check capture quality and throw an error if bad.
                if (!_sender.CheckCaptureResult(captureResult)) return;

                foreach (Fid.Fiv fiv in captureResult.Data.Views)
                {
                    SendMessage3(Action3.SendBitmap3, _sender.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                    a = fiv.Bytes;
                    String aas =Convert.ToString(fiv.Bytes);

                }
                DataResult<fmd> resultConversion = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI);
                //   Convert.ToString(resultConversion.Data)
                DataTable dt = new DataTable();


                dt = getdata(a);
                if (dt.Rows.Count &gt; 0)
                {
                    fingervalue = Fmd.SerializeXml(resultConversion.Data);

                    //====================================================================

                    if (resultConversion.ResultCode != Constants.ResultCode.DP_SUCCESS)
                    {
                        _sender.Reset = true;
                        throw new Exception(resultConversion.ResultCode.ToString());
                    }


                    // =======1 End=========//


                    firstFinger = Fmd.DeserializeXml(Convert.ToString(dt.Rows[1]["Finger_Value"]));


                    if (count == 0)
                    {
                        SendMessage(Action.SendMessage, "Enrollment 3.");

                        thirdFinger = resultConversion.Data;
                        CompareResult compareResult = Comparison.Compare(firstFinger, 0, thirdFinger, 0);
                        if (compareResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                        {
                            _sender.Reset = true;
                            throw new Exception(compareResult.ResultCode.ToString());
                        }

                        String m1 = " (fingerprints matched)";
                        String m2 = " (fingerprints did not match)";
                        SendMessage(Action.SendMessage, "Comparison resulted in a dissimilarity score of " +
                        compareResult.Score.ToString() + (compareResult.Score &lt; (PROBABILITY_ONE / 100000) ? m1 : m2));
                        if (compareResult.Score &lt; (PROBABILITY_ONE / 100000))
                        {

                            //=======3 start=========//
                            try
                            {
                                // Check capture quality and throw an error if bad.
                                if (!_sender.CheckCaptureResult(captureResult)) return;

                                // Create bitmap
                                foreach (Fid.Fiv fiv in captureResult.Data.Views)
                                {
                                    SendMessage3(Action3.SendBitmap3, _sender.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                                    //fingervalue = Fmd.SerializeXml(resultConversion.Data); ;
                                    //widht = fiv.Width;
                                    //height = fiv.Height;
                                    //System.Text.Encoding.UTF8.GetString(byteArray);

                                }
                            }
                            catch (Exception ex)
                            {
                                // Send error message, then close form
                                SendMessage(Action.SendMessage, "Error:  " + ex.Message);
                            }
                            //========3 End========//
                        }
                        else
                        {
                            // pictureBox2.Image =;
                            pictureBox2.Image = null;
                            //pictureBox2.Refresh();
                        }
                        SendMessage(Action.SendMessage, "Place a finger on the reader.");
                        count = 0;
                    }
                    //====================================================================
                }
                else
                {
                    if (resultConversion.ResultCode != Constants.ResultCode.DP_SUCCESS)
                    {
                        _sender.Reset = true;
                        throw new Exception(resultConversion.ResultCode.ToString());
                    }

                    if (count == 0)
                    {
                        SendMessage(Action.SendMessage, "Enrollment 1.");
                        //  =======1 start=========//
                        try
                        {
                            // Check capture quality and throw an error if bad.
                            if (!_sender.CheckCaptureResult(captureResult)) return;

                            // Create bitmap
                            foreach (Fid.Fiv fiv in captureResult.Data.Views)
                            {
                                SendMessage1(Action1.SendBitmap, _sender.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                                fingervalue = Fmd.SerializeXml(resultConversion.Data);
                                widht = fiv.Width;
                                height = fiv.Height;
                                a = fiv.Bytes;
                                savedata();
                            }

                        }
                        catch (Exception ex)
                        {
                            // Send error message, then close form
                            SendMessage(Action.SendMessage, "Error:  " + ex.Message);
                        }
                        // =======1 End=========//

                        firstFinger = resultConversion.Data;
                        //Byte a;
                        //int b, c;
                        // String abc;
                        //firstFinger = (Fmd)abc;

                        count += 1;
                        SendMessage(Action.SendMessage, "Now place the same finger on the reader.");
                    }
                    else if (count == 1)
                    {
                        SendMessage(Action.SendMessage, "Enrollment 2.");

                        //=======2 Start=========//
                        try
                        {
                            // Check capture quality and throw an error if bad.
                            if (!_sender.CheckCaptureResult(captureResult)) return;

                            // Create bitmap
                            foreach (Fid.Fiv fiv in captureResult.Data.Views)
                            {
                                SendMessage2(Action2.SendBitmap2, _sender.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                                fingervalue = Fmd.SerializeXml(resultConversion.Data); ;
                                widht = fiv.Width;
                                height = fiv.Height;
                                a = fiv.Bytes;
                                savedata();
                            }
                        }
                        catch (Exception ex)
                        {
                            // Send error message, then close form
                            SendMessage(Action.SendMessage, "Error:  " + ex.Message);
                        }
                        //======2 End==========//
                        secondFinger = resultConversion.Data;
                        count += 1;
                        SendMessage(Action.SendMessage, "Now place the same finger on the reader.");
                    }
                    else if (count == 2)
                    {
                        SendMessage(Action.SendMessage, "Enrollment 3.");

                        thirdFinger = resultConversion.Data;
                        CompareResult compareResult = Comparison.Compare(secondFinger, 0, thirdFinger, 0);
                        if (compareResult.ResultCode != Constants.ResultCode.DP_SUCCESS)
                        {
                            _sender.Reset = true;
                            throw new Exception(compareResult.ResultCode.ToString());
                        }

                        String m1 = " (fingerprints matched)";
                        String m2 = " (fingerprints did not match)";
                        SendMessage(Action.SendMessage, "Comparison resulted in a dissimilarity score of " +
                        compareResult.Score.ToString() + (compareResult.Score &lt; (PROBABILITY_ONE / 100000) ? m1 : m2));
                        if (compareResult.Score &lt; (PROBABILITY_ONE / 100000))
                        {

                            //=======3 start=========//
                            try
                            {
                                // Check capture quality and throw an error if bad.
                                if (!_sender.CheckCaptureResult(captureResult)) return;

                                // Create bitmap
                                foreach (Fid.Fiv fiv in captureResult.Data.Views)
                                {
                                    SendMessage3(Action3.SendBitmap3, _sender.CreateBitmap(fiv.RawImage, fiv.Width, fiv.Height));
                                    fingervalue = Fmd.SerializeXml(resultConversion.Data); ;
                                    widht = fiv.Width;
                                    height = fiv.Height;
                                    a = fiv.Bytes;
                                    savedata();
                                    //System.Text.Encoding.UTF8.GetString(byteArray);
                                }
                            }
                            catch (Exception ex)
                            {
                                // Send error message, then close form
                                SendMessage(Action.SendMessage, "Error:  " + ex.Message);
                            }
                            //========3 End========//
                        }
                        else
                        {
                            // pictureBox2.Image =;
                            pictureBox2.Image = null;
                            //pictureBox2.Refresh();
                        }
                        SendMessage(Action.SendMessage, "Place a finger on the reader.");
                        count = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                // Send error message, then close form
                SendMessage(Action.SendMessage, "Error:  " + ex.Message);
            }

        }</fmd>
Posted
Updated 17-Aug-16 0:09am
v2
Comments
Kornfeld Eliyahu Peter 17-Aug-16 6:16am    
Not clear... Are you saying that the scanner returns different code for the same finger every time?
(It would help to clean the unrelated code from this dump)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900