Sie sind auf Seite 1von 3

IN SAVING I USED THIS

For Each template As DPFP.Template In Data.Templates


If Not template Is Nothing Then
cmd = New MySqlCommand("INSERT INTO employeefp " +
"SET No=@No, " +
"FP=@FP " +
" ", conn)

cmd.Parameters.Add(New MySqlParameter("@No", txtEmpNo.Text))
cmd.Parameters.Add(New MySqlParameter("@FP", template.Bytes))

cmd.ExecuteNonQuery()

End If
Next
IN VERIFYING FROM THE DB I USED THIS
1. WHEN FORM IS LOADED I FETCH ALL THE FINGER PRINTS
2. Dim cmd As New MySqlCommand("SELECT * FROM employeefp ", conn)
3. Dim rdr As MySqlDataReader = cmd.ExecuteReader()
4.
5. While (rdr.Read())
6. Dim MemStream As IO.MemoryStream
7. Dim fpBytes As Byte()
8.
9. fpBytes = rdr("FP")
10. MemStream = New IO.MemoryStream(fpBytes)
11.
12. Dim templa8 As DPFP.Template = New DPFP.Template()
13. templa8.DeSerialize(MemStream)
14.
15. Dim tmpObj As New AppData
16. tmpObj.No = rdr("No").ToString()
17. tmpObj.Template = templa8
18. FPList.Add(tmpObj)
End While
NOTE : Dim FPList As List(Of AppData) = New List(Of AppData) //you can find the definition of this in the SDK i
just added Template (contains one print) aside from the existing Templates(contains many print)
1. COMPARE THE CURRENT SAMPLE FROM THE MACHINE
2. Sub OnComplete(ByVal Control As Object, ByVal FeatureSet As DPFP.FeatureSet, ByRef
EventHandlerStatus As DPFP.Gui.EventHandlerStatus) Handles
VerificationControl.OnComplete
3. Dim printFound As Boolean = False
4. VerifiedFPData = New AppData
5. Try
6. For Each FPData As AppData In FPList
7. Dim tmplateData As New DPFP.Template
8. tmplateData = FPData.Template
9. Dim compareTo As New DPFP.FeatureSet
10. compareTo = FeatureSet
11.
12. Dim ver As New DPFP.Verification.Verification()
13. Dim res As New DPFP.Verification.Verification.Result()
14.
15. If Not tmplateData Is Nothing Then
16. ver.Verify(FeatureSet, tmplateData, res)
17.
18. If res.Verified Then
19. EventHandlerStatus = DPFP.Gui.EventHandlerStatus.Success
20. printFound = True
21. VerifiedFPData = FPData
22. Exit For ' success
23. End If
24. End If
25. Next
26. Catch ex As Exception
27. MessageBox.Show("verification error")
28. End Try
29.
30.
31. If printFound Then
32. //TO DO
33. Else
34. EventHandlerStatus = DPFP.Gui.EventHandlerStatus.Failure
35. // TODO
End If
End Sub
hope it helps someone :)
share|improve this answer answered Aug 21 '13 at 2:49



dynamicnetpaper
212
add a comment

up
vote1down
vote
There are some missing codes from the answer above. The code of the class appdata is missing.These code is error without declaring first the
tmpObj in the class AppData. Dim tmpObj As New AppData tmpObj.No = rdr("No").ToString() tmpObj.Template =
templa8 FPList.Add(tmpObj)

Das könnte Ihnen auch gefallen