private void AddBir(string userName, string finger, string serviceObject, BiometricsInformationRecord bir) { try { StoredBir sb = new StoredBir(userName, finger, serviceObject, bir); Birs.Add(sb); lbBirs.Items.Add(sb); SaveBirs(); } catch (Exception ae) { ShowException(ae); } }
private void btnDeleteBir_Click(object sender, EventArgs e) { try { if (lbBirs.SelectedIndex >= 0) { StoredBir sb = (StoredBir)lbBirs.SelectedItem; lbBirs.Items.Remove(sb); Birs.Remove(sb); SaveBirs(); } } catch (Exception ae) { ShowException(ae); } }
private void btnVerify_Click(object sender, EventArgs e) { Cursor old = Cursor.Current; Cursor.Current = Cursors.WaitCursor; try { //lblStatusText.Text = "Please swipe finger"; pbImageData.Image = null; StoredBir sb = (StoredBir)lbBirs.SelectedItem; bool adaptBIR = chkBoxAdaptBir.Checked; int maxFAR = 0; int maxFRR = 0; if (rbUseFAR.Checked) { maxFAR = int.Parse(tbRate.Text); } else { maxFRR = int.Parse(tbRate.Text); } BiometricsVerifyResult result = _biometrics.Verify(maxFAR, maxFRR, rbUseFAR.Checked, sb, adaptBIR, int.Parse(tbBioTimeout.Text)); string status = "Verification failed for: " + sb.ToString(); if (result.Result == true) { lblStatusText.Text = "Verified as: " + sb.ToString(); DisplayMessage("Verification succeeded for: " + sb.ToString() + "\r\n" + "FalseAcceptRateAchieved: " + result.FalseAcceptRateAchieved + "\r\n" + "FalseRejectRateAchieved: " + result.FalseRejectRateAchieved); // save updated bir if (adaptBIR && result.AdaptedBir != null) { StoredBir newBir = new StoredBir(sb.Name, sb.Finger, _biometrics.ToString(), result.AdaptedBir); Birs.Remove(sb); lbBirs.Items.Remove(sb); Birs.Add(newBir); lbBirs.SelectedIndex = lbBirs.Items.Add(newBir); SaveBirs(); DisplayMessage("Saved adapted BIR."); } } else { lblStatusText.Text = "Verification failed for: " + sb.ToString(); if (result == null) { DisplayMessage("Verification failed for: " + sb.ToString()); } else { DisplayMessage("Verification failed for: " + sb.ToString() + "\r\n" + "FalseAcceptRateAchieved: " + result.FalseAcceptRateAchieved + "\r\n" + "FalseRejectRateAchieved: " + result.FalseRejectRateAchieved); } } } catch (Exception ae) { ShowException(ae); } finally { Cursor.Current = old; } }
private void btnVerify_Click(object sender, EventArgs e) { Cursor old = Cursor.Current; Cursor.Current = Cursors.WaitCursor; try { //lblStatusText.Text = "Please swipe finger"; pbImageData.Image = null; StoredBir sb = (StoredBir)lbBirs.SelectedItem; bool adaptBIR = chkBoxAdaptBir.Checked; int maxFAR = 0; int maxFRR = 0; if (rbUseFAR.Checked) maxFAR = int.Parse(tbRate.Text); else maxFRR = int.Parse(tbRate.Text); BiometricsVerifyResult result = _biometrics.Verify(maxFAR, maxFRR, rbUseFAR.Checked, sb, adaptBIR, int.Parse(tbBioTimeout.Text)); string status = "Verification failed for: " + sb.ToString(); if (result.Result == true) { lblStatusText.Text = "Verified as: " + sb.ToString(); DisplayMessage("Verification succeeded for: " + sb.ToString() + "\r\n" + "FalseAcceptRateAchieved: " + result.FalseAcceptRateAchieved + "\r\n" + "FalseRejectRateAchieved: " + result.FalseRejectRateAchieved); // save updated bir if (adaptBIR && result.AdaptedBir != null) { StoredBir newBir = new StoredBir(sb.Name, sb.Finger, _biometrics.ToString(), result.AdaptedBir); Birs.Remove(sb); lbBirs.Items.Remove(sb); Birs.Add(newBir); lbBirs.SelectedIndex = lbBirs.Items.Add(newBir); SaveBirs(); DisplayMessage("Saved adapted BIR."); } } else { lblStatusText.Text = "Verification failed for: " + sb.ToString(); if (result == null) { DisplayMessage("Verification failed for: " + sb.ToString()); } else { DisplayMessage("Verification failed for: " + sb.ToString() + "\r\n" + "FalseAcceptRateAchieved: " + result.FalseAcceptRateAchieved + "\r\n" + "FalseRejectRateAchieved: " + result.FalseRejectRateAchieved); } } } catch (Exception ae) { ShowException(ae); } finally { Cursor.Current = old; } }