none
zkteco teco 4500 RRS feed

  • Question

  •  need help how to verify the all fingerprint in the data. i can verify using textbox.

    Private Sub AddStaff()
            Try
                sqL = "INSERT INTO tbl_finger(staffid, fingerdata) VALUES( '" & lblStaffNo.Text & "','" & text1Finger.Text & "' )"
                ConnDB()
                cmd = New MySqlCommand(sqL, conn)
                cmd.ExecuteNonQuery()
                MsgBox("New staff successfully added.", MsgBoxStyle.Information, "Add Staff")
                ClearFields()
            Catch ex As Exception
                MsgBox(ex.ToString)
            Finally
                cmd.Dispose()
                conn.Close()
            End Try
        End Sub 
    
        Private Sub LoadUpdateStaff()
            Try
                sqL = "SELECT * FROM staff WHERE staffid = '" & frmStaff.ListView1.FocusedItem.Text & "'"
                ConnDB()
                cmd = New MySqlCommand(sqL, conn)
                dr = cmd.ExecuteReader
    
                If dr.Read = True Then
                    lblStaffNo.Text = dr("staffid")
                    txtLastname.Text = dr("lastname")
                    txtFirstname.Text = dr("firstname")
                    txtMI.Text = dr("MI")
                    'text1Finger = dr("fingerdata")
                End If
            Catch ex As Exception
                MsgBox(ex.ToString)
            Finally
                cmd.Dispose()
                conn.Close()
            End Try
        End Sub
    
        Private Sub ClearFields()
            lblStaffNo.Text = ""
            txtLastname.Text = ""
            txtFirstname.Text = ""
            txtMI.Text = ""
            'text1Finger.Text = ""
        End Sub
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            AxZKFPEngX1.EndEngine()
            Me.Close()
        End Sub
    
        Private Sub frmAddUpdateStaff_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If frmStaff.adding = True Then
                lblTitle.Text = "Adding New Staff"
                ClearFields()
                'GetStaffID()
                LoadUpdateStaff()
            Else
                lblTitle.Text = "Updating Staff"
                LoadUpdateStaff()
            End If
    
            If (AxZKFPEngX1.InitEngine = 0) Then
                AxZKFPEngX1.FPEngineVersion = "9"
                Dim fpcHandle As Integer = AxZKFPEngX1.CreateFPCacheDBEx()
                'If AxZKFPEngX1.SensorSN() <> "{CB273F0D-686A-4E17-8B2A-84C6D0DD68D4}" Then End
                StatusLabel2.Text = "Serial Number: " + AxZKFPEngX1.SensorSN() + "   /   "
                StatusLabel1.Text = "Sensor Number: " + AxZKFPEngX1.SensorCount().ToString + "  /   "
                Label1.Text = "Initial Succeed"
            Else
                AxZKFPEngX1.EndEngine()
                Label1.Text = "Initial Failed"
            End If
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            If frmStaff.adding = True Then
                AddStaff()
                Me.Close()
            Else
                'UpdateStaff()
                frmStaff.LoadStaffs()
                Me.Close()
            End If
        End Sub
    
        Private Sub frmAddUpdateStaff_Closed(sender As Object, e As EventArgs) Handles Me.Closed
            AxZKFPEngX1.EndEngine()
            AxZKFPEngX1.EndInit()
    
        End Sub
    
        Private Sub cmdRegister_Click(sender As Object, e As EventArgs) Handles cmdRegister.Click
            AxZKFPEngX1.CancelEnroll()
            AxZKFPEngX1.EnrollCount = 3
            AxZKFPEngX1.BeginEnroll()
            StatusLabel3.Text = "Start Register"
            Dim ll = From cont In GroupBox2.Controls Where cont.Name.Contains("finger") Order By cont.text, cont.name
    
            'For Each control As Control In GroupBox2.Controls
            For Each control As Control In ll
                If control.Name.Contains("text") And TypeOf (control) Is TextBox Then
                    If control.Text = "" Or control.Text = " " Then
                        control.Focus()
                        Exit For
                    End If
                End If
            Next
        End Sub
        Private Sub setText(ByVal sRegTemplateX As String)
            If (text1Finger.Focused) Then
                text1Finger.Text = sRegTemplateX
            ElseIf (text2Finger.Focused) Then
                text2Finger.Text = sRegTemplateX
            ElseIf (text3Finger.Focused) Then
                text3Finger.Text = sRegTemplateX
            ElseIf (text4Finger.Focused) Then
                text4Finger.Text = sRegTemplateX
            ElseIf (text5Finger.Focused) Then
                text5Finger.Text = sRegTemplateX
            ElseIf (text6Finger.Focused) Then
                text6Finger.Text = sRegTemplateX
            ElseIf (text7Finger.Focused) Then
                text7Finger.Text = sRegTemplateX
            ElseIf (text8Finger.Focused) Then
                text8Finger.Text = sRegTemplateX
            ElseIf (text9Finger.Focused) Then
                text9Finger.Text = sRegTemplateX
            ElseIf (text10Finger.Focused) Then
                text10Finger.Text = sRegTemplateX
            End If
        End Sub
    
        Private Sub AxZKFPEngX1_OnEnroll(sender As Object, e As IZKFPEngXEvents_OnEnrollEvent) Handles AxZKFPEngX1.OnEnroll
            Dim FPID As Integer
            Dim fpcHandle As Integer
            If (Not e.actionResult) Then
                MsgBox("Registration Failed")
            Else
                sRegTemplate = AxZKFPEngX1.GetTemplateAsStringEx("9")
                If (lblStaffNo.Text <> "") Then
                    'TextFinger.Text = sRegTemplate
                    setText(sRegTemplate)
                End If
                sRegTemplate10 = AxZKFPEngX1.GetTemplateAsStringEx("10")
                If (sRegTemplate.Length > 0) Then
                    If (sRegTemplate10.Length > 0) Then
                        AxZKFPEngX1.AddRegTemplateStrToFPCacheDBEx(fpcHandle, FPID, sRegTemplate, sRegTemplate10)
                    Else
                        MsgBox("Registration Failed, Template length is Zero")
                    End If
                    e.aTemplate = AxZKFPEngX1.DecodeTemplate1(sRegTemplate)
                    AxZKFPEngX1.SetTemplateLen(e.aTemplate, 602)
                    AxZKFPEngX1.SaveTemplate("fingerprint.tpl", e.aTemplate)
                    FPID = FPID + 1
                    MsgBox("Registration Succeed")
                    Label1.Text = "Wait"
                Else
                    MsgBox("Registration Failed ,Template length is zero")
                End If
            End If
        End Sub
    
        Private Sub AxZKFPEngX1_OnImageReceived(sender As Object, e As IZKFPEngXEvents_OnImageReceivedEvent) Handles AxZKFPEngX1.OnImageReceived
            Dim HDC As Long = PB_finger.CreateGraphics.GetHdc.ToInt32
            If (e.aImageValid) Then
                AxZKFPEngX1.PrintImageAt(HDC, 0, 0, AxZKFPEngX1.ImageWidth, AxZKFPEngX1.ImageHeight)
            End If
        End Sub
    
    
    
     Private Sub AxZKFPEngX1_OnCapture(sender As Object, e As IZKFPEngXEvents_OnCaptureEvent) Handles AxZKFPEngX1.OnCapture
            Dim id As Integer = 0
            Dim Score As Integer = 0
            Dim ProcessNum As Integer = 0
            Dim buffer(63) As SByte
            Dim sTemp As String = String.Empty
            Dim RegChanged As Boolean = False
            If (matchType = 1) Then
                Dim bTemp As String = String.Empty
                sTemp = AxZKFPEngX1.GetTemplateAsString()
    
                If (text1Finger.Focused) Then
                    bTemp = text1Finger.Text
                End If
    
                If (AxZKFPEngX1.VerFingerFromStr(bTemp, sTemp, False, RegChanged)) Then
                    Label1.Text = "Verification Succeed!!!"
                Else
                    Label1.Text = "Verification Failed!!!"
                End If
            End If
        End Sub

                 
    Thursday, March 22, 2018 3:26 AM

All replies

  • Please indicate the portion of the code with the issue and show us what you are trying to do.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Thursday, March 22, 2018 3:35 AM
    Moderator
  • Hi jan,

    How do you want to verify them? Do you mean to judge whether they already exist in the database? Or other needs? Please provide more details for your purpose.

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 23, 2018 8:09 AM