如何将注册指纹直接保存到MySQL数据库(VB.net)(Digital Persona U.are.U 4500) [英] How to save the enrolled fingerprint directly to MySQL database (VB.net) (Digital Persona U.are.U 4500)

查看:188
本文介绍了如何将注册指纹直接保存到MySQL数据库(VB.net)(Digital Persona U.are.U 4500)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

**这些是注册指纹的代码。但我希望它直接保存在MySQL数据库中。



**These are the codes of enrolling fingerprint. but I want it to save directly in MySQL database.

' NOTE: This form is inherited from the CaptureForm,
' so the VisualStudio Form Designer may not load this properly
' (at least until you build the project).
' If you want to make changes in the form layout - do it in the base CaptureForm.
' All changes in the CaptureForm will be reflected in all derived forms 
' (i.e. in the EnrollmentForm and in the VerificationForm)


Public Class EnrollmentForm
  Inherits CaptureForm

  Public Event OnTemplate(ByVal template)

  Private Enroller As DPFP.Processing.Enrollment

  Protected Overrides Sub Init()
    MyBase.Init()
    MyBase.Text = "Fingerprint Enrollment"
    Enroller = New DPFP.Processing.Enrollment()     ' Create an enrollment.
    UpdateStatus()
  End Sub

  Protected Overrides Sub Process(ByVal Sample As DPFP.Sample)
    MyBase.Process(Sample)

    ' Process the sample and create a feature set for the enrollment purpose.
    Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment)

    ' Check quality of the sample and add to enroller if it's good
    If (Not features Is Nothing) Then
      Try
        MakeReport("The fingerprint feature set was created.")
        Enroller.AddFeatures(features)        ' Add feature set to template.
      Finally
        UpdateStatus()

        ' Check if template has been created.
        Select Case Enroller.TemplateStatus
          Case DPFP.Processing.Enrollment.Status.Ready    ' Report success and stop capturing
            RaiseEvent OnTemplate(Enroller.Template)
            SetPrompt("Click Close, and then click Fingerprint Verification.")
            StopCapture()

          Case DPFP.Processing.Enrollment.Status.Failed   ' Report failure and restart capturing
            Enroller.Clear()
            StopCapture()
            RaiseEvent OnTemplate(Nothing)
            StartCapture()

        End Select
      End Try
    End If
  End Sub

  Protected Sub UpdateStatus()
    ' Show number of samples needed.
    SetStatus(String.Format("Fingerprint samples needed: {0}", Enroller.FeaturesNeeded))
  End Sub

End Class

推荐答案

可以在Enroller.Template中找到已注册的指纹数据。然后使用MemoryStream来保存和序列化所述指纹数据。然后将memorystream传递给你的byte [],以便将它上传到数据库中的longblob列。





这是我的示例代码以c#格式:



The enrolled fingerprint data can be found in Enroller.Template. Then use MemoryStream to to save and serialize the said fingerprint data. then pass the memorystream to your byte[] in order to upload it to your longblob column in your database.


Here's My example code in c# format:

byte[] byted;
private void featureS()
        {
            this.Invoke(new Function(delegate ()
            {
                MemoryStream fingerprintData = new MemoryStream();
                Enroller.Template.Serialize(fingerprintData);
                byted = fingerprintData.ToArray();

                //insert your mysql command here then
            }));
        }





我希望这会给你一个想法。但在保存指纹模板之前,必须首先验证它是否已经存在于数据库中。



I hope this gives you an idea. But before you save the fingerprint template, you must first verify if it already exist in the database.


好日子先生Louie Aguilar,你有VB代码的样本吗?提前谢谢:)
Good day sir Louie Aguilar, Do you have sample for this in VB codes? thanks in advance :)


这篇关于如何将注册指纹直接保存到MySQL数据库(VB.net)(Digital Persona U.are.U 4500)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆