i now can save a fingerprint template from database using this code..

Dim fingerprintData As MemoryStream = New MemoryStream
        Template.Serialize(fingerprintData)
        fingerprintData.Position = 0
        Dim br As BinaryReader = New BinaryReader(fingerprintData)
        Dim bytes() As Byte = br.ReadBytes(CType(fingerprintData.Length, Int32))
        Dim cmd As SqlCommand = New SqlCommand("INSERT INTO fininger_table VALUES(@FIRSTNAME, @LASTNAME, @FINGERPRINT)", conn)
        cmd.Parameters.Add("FIRSTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxFname.Text
        cmd.Parameters.Add("LASTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxLname.Text
        cmd.Parameters.Add("FINGERPRINT", SqlDbType.Image).Value = bytes
        conn.Open()
        cmd.ExecuteNonQuery()
        conn.Close()

and i fetch the data when the form is load..

 conn.Open()
        Dim cmd As New SqlCommand("SELECT * FROM Fininger_table", conn)
        Dim rdr As SqlDataReader = cmd.ExecuteReader()
        Dim MemStream As IO.MemoryStream
        Dim fpBytes As Byte()
        While rdr.Read()
            fpBytes = rdr("FINGERPRINT")
            MemStream = New IO.MemoryStream(fpBytes)
            Dim template As New DPFP.Template(MemStream)
            OnTemplate(template)
            ' template.DeSerialize(MemStream)
        End While
        rdr.Close()
        conn.Close()

and now i'm stuck..i dont know how to match the fingerprint from the database to verify the user..

plz help me out..tnx in advance

btw im using a DIGITAL PERSONA FINGERPRINT READER..with the OTW SDK

Recommended Answers

All 8 Replies

i already seen that too..but im confused bout the "Dim FPList As List(Of AppData) = New List(Of AppData)" thing that he do..sigh

dude did you already solved your problem? cause I got same problem here. Need help

this's old sample code for UareU 4500..
connection to DB using MyAccess but u can modify it to work with SQL or MySQL server..
you need uareu SDK to use this code

Option Strict Off
Option Explicit On
Friend Class frmVerification
    Inherits System.Windows.Forms.Form

    Dim FPDatabase As New UareUSDK.clsFPDatabase
    Dim WithEvents Verification As UareUSDK.clsFPVerification

    Private Sub frmVerification_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
        On Error GoTo ErrMsg

        If FPDatabase.ActiveConnection("DRIVER={Microsoft Access Driver (*.mdb)};" & "pwd=;" & "UID=Admin;" & "DBQ=" & My.Application.Info.DirectoryPath & "\SampleDB.mdb") = UareUSDK.StatusConnection.sc_Success Then
            MsgBox("Database Connection Success")
        Else
            MsgBox("Database Connection Fail")
        End If

        Verification = New UareUSDK.clsFPVerification
        Verification.PictureSamplePath = My.Application.Info.DirectoryPath & "\FPTemp.BMP"
        Verification.PictureSampleHeight = VB6.PixelsToTwipsY(picSample.Height)
        Verification.PictureSampleWidth = VB6.PixelsToTwipsX(picSample.Width)

        'Wait until a finger on device
        Verification.FPVerification()

        Exit Sub
ErrMsg:
        If Err.Number = 430 Then
            MsgBox("You need to recompile your aplication to use the latest SDK version")
        Else
            MsgBox(Err.Description)
        End If
    End Sub

    Private Sub Verification_FPVerificationID(ByRef ID As String, ByRef FingerNr As UareUSDK.FingerNumber) Handles Verification.FPVerificationID
        Text2.Text = Text2.Text & ID & " (" & CStr(FingerNr) & ")" & vbNewLine
    End Sub

    Private Sub Verification_FPVerificationImage() Handles Verification.FPVerificationImage
        Text2.Text = ""
        Text3.Text = ""

        picSample.Image = Nothing
        GC.Collect()

        If My.Computer.FileSystem.FileExists(My.Application.Info.DirectoryPath & "\FPTempVerification2.BMP") Then

            My.Computer.FileSystem.CopyFile(My.Application.Info.DirectoryPath & "\FPTemp.BMP", My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP")
            picSample.Image = System.Drawing.Image.FromFile(My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP")
            My.Computer.FileSystem.DeleteFile(My.Application.Info.DirectoryPath & "\FPTempVerification2.BMP")

        ElseIf My.Computer.FileSystem.FileExists(My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP") Then

            My.Computer.FileSystem.CopyFile(My.Application.Info.DirectoryPath & "\FPTemp.BMP", My.Application.Info.DirectoryPath & "\FPTempVerification2.BMP")
            picSample.Image = System.Drawing.Image.FromFile(My.Application.Info.DirectoryPath & "\FPTempVerification2.BMP")
            My.Computer.FileSystem.DeleteFile(My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP")

        Else

            My.Computer.FileSystem.CopyFile(My.Application.Info.DirectoryPath & "\FPTemp.BMP", My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP")
            picSample.Image = System.Drawing.Image.FromFile(My.Application.Info.DirectoryPath & "\FPTempVerification1.BMP")
        End If

        'Set filter criteria
        If Len(Text1.Text) = 0 Then
            'Search all finger samples
            Verification.FPVerificationFilter("")
        Else
            'Search only finger samples in criteria
            Verification.FPVerificationFilter("ID Like '" & Text1.Text & "%'")
        End If
    End Sub

    Private Sub Verification_FPVerificationStatus(ByRef Status As UareUSDK.VerificationStatus) Handles Verification.FPVerificationStatus
        Select Case Status
            Case UareUSDK.VerificationStatus.v_MultiplelMatch
                Text3.Text = "Multiple Match"
            Case UareUSDK.VerificationStatus.v_OK
                Text3.Text = "Match"
            Case UareUSDK.VerificationStatus.v_NotFound
                Text3.Text = "Not Found"
            Case UareUSDK.VerificationStatus.v_WrongDeviceSN
                Text3.Text = "Wrong Device Serial Number"
                Exit Sub
            Case UareUSDK.VerificationStatus.v_VerFailed
                Text3.Text = "Verification Failed"
                Exit Sub
            Case UareUSDK.VerificationStatus.v_NoDevice
                Text3.Text = "Device not exits"
                Exit Sub
        End Select

        'Wait for the next finger
        Verification.FPVerification()
    End Sub
End Class

download sample code :https://goo.gl/m1PXuq

@Rakhmat

downloaded your sample code its not working.. if it is working can it save the fingerprint on the database and verify it ?

no and im not trying that thing ..

How is the image being stored in the database? Subsequent reads of a fingerprint will not exactly match previous ones, such as that stored in the database. Fingerprint readers will look for a correlate major features (ridges, etc) to generate a match using statistical processes. I would assume the FPVerification function from UareUSDK.clsFPVerification does that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.