自动验证用户的指纹[BLOB]

时间:2014-03-08 11:00:53

标签: mysql vb.net blob fingerprint

您好?我这里有指纹扫描仪。我想在用户触摸扫描仪时自动验证用户的指纹,但我不能。

我有这里的代码,但在您验证指纹是否正确之前,您需要先输入他/她的用户ID。

这是我的代码:

Private Sub SaveButton_Click() Handles SaveButton.Click
        Using files As New IO.MemoryStream
            Template.Serialize(files)
            objconn.Open()
            If Not Template Is Nothing Then
                Dim cmd = New MySqlCommand("INSERT INTO employeefp " +
                                  "SET id=@id, " +
                                  "FP=@FP " + 
" ", objconn)

                cmd.Parameters.Add(New MySqlParameter("@id", TextBox1.Text))
                cmd.Parameters.Add(New MySqlParameter("@FP", Template.Bytes))

                cmd.ExecuteNonQuery()
                objconn.Close()
                MessageBox.Show("Template Successfuly Saved.", "Finger Enrolled")
            End If
        End Using

 End Sub

这是我的验证按钮代码:

   Private Sub VerifyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VerifyButton.Click
        If TextBox1.Text = "" Then
            MsgBox("Please input id no.", MsgBoxStyle.Information)
        Else
            objconn.Open()
            Dim cmd As New MySqlCommand("SELECT * FROM employeefp where id ='" & TextBox1.Text & "'", objconn)
            Dim rdr As MySqlDataReader = cmd.ExecuteReader()
            rdr.Read()
            If rdr.HasRows Then
                Dim Verifier As New VerificationForm
                Verifier.Verify(Template)
            Else
                MsgBox("The id doesn`t exist", MsgBoxStyle.Information)
            End If
        End If
        objconn.Close()
    End Sub

我在templates.bytes中想到了这一切,但我不知道我会做什么。 提前致谢。希望你能帮助我。

0 个答案:

没有答案