-
Notifications
You must be signed in to change notification settings - Fork 4
/
V_Verification.cs
87 lines (79 loc) · 3.18 KB
/
V_Verification.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SQLite;
using System.Drawing;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace UI_Support
{
public partial class V_Verification : Form
{
TempStorage tempstorage = TempStorage.Instance;
private AppData Data;
public V_Verification(AppData data)
{
InitializeComponent();
Data = data;
}
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 = "";
}
}
}