コード例 #1
0
        private void btnIdentify_Click(object sender, EventArgs e)
        {
            Cursor old = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                //lblStatusText.Text = "Please swipe finger";
                pbImageData.Image = null;

                lblStatusText.Update();
                pbImageData.Update();


                // get a list of the birs for this service object
                List <BiometricsInformationRecord> birs = new List <BiometricsInformationRecord>(BirIterator(_biometrics.ToString()));
                int maxFAR = 0;
                int maxFRR = 0;
                if (rbUseFAR.Checked)
                {
                    maxFAR = int.Parse(tbRate.Text);
                }
                else
                {
                    maxFRR = int.Parse(tbRate.Text);
                }

                int[] order = _biometrics.Identify(maxFAR, maxFRR, rbUseFAR.Checked, birs, int.Parse(tbBioTimeout.Text));

                string identifiedAs = "No Match found.";
                if (order != null && order.Length > 0)
                {
                    identifiedAs = birs[order[0]].ToString();
                }

                lblStatusText.Text = "Identified as: " + identifiedAs;
                DisplayMessage("Identified as: " + identifiedAs);
            }
            catch (Exception ae)
            {
                ShowException(ae);
            }
            finally
            {
                Cursor.Current = old;
            }
        }