如何使用vb.net在MySql中保存和检索指纹模板?

如何使用vb.net在MySql中保存和检索指纹模板?,mysql,vb.net,vb.net-2010,fingerprint,Mysql,Vb.net,Vb.net 2010,Fingerprint,我对vb.net和mysql上的指纹很陌生。我刚开始尝试使用DigitalPersonaU.are.U4500,我不知道如何将模板保存到Mysql数据库。我还想从Mysql检索数据。这是代码。谢谢大家!` Private Enroller As DPFP.Processing.Enrollment Protected Overrides Sub Init() MyBase.Init() MyBase.Text = "Fingerprint Enrollment" Enr

我对vb.net和mysql上的指纹很陌生。我刚开始尝试使用DigitalPersonaU.are.U4500,我不知道如何将模板保存到Mysql数据库。我还想从Mysql检索数据。这是代码。谢谢大家!`

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

Private Sub EnrollmentForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

End Sub
Private Sub InitializeComponent()
    Me.SuspendLayout()
    '
    'bioenrollment
    '
    Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
    Me.ClientSize = New System.Drawing.Size(1266, 630)
    Me.Name = "bioenrollment"
    Me.ResumeLayout(False)
    Me.PerformLayout()

End Sub`

DigitalPersona指纹读取器将允许您将指纹序列化为XML文件……您只需将其作为Varchar(MAX)存储在数据库中即可。

请尝试插入此代码

私有子按钮1\u单击(ByVal sender作为System.Object,ByVal e作为System.EventArgs)处理按钮1。单击

    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 SQLconnect As New SQLite.SQLiteConnection()
    Dim SQLcommand As SQLiteCommand
    SQLconnect.ConnectionString = "data source=C:\Users\mypc\Documents\MatrixDbase.s3db"
    SQLconnect.Open()
    SQLcommand = SQLconnect.CreateCommand

    SQLcommand.CommandText = "INSERT INTO Longin (id, Fname, Lname, Pic) VALUES ('" & TextBox1.Text & "', '" & TextBox2.Text & "', '" & TextBox3.Text & "', @Pic)"

    SQLcommand.Parameters.AddWithValue("@Pic", bytes)
    'Runs Query
    SQLcommand.ExecuteNonQuery()
    SQLcommand.Dispose()
    SQLconnect.Close()

End Sub

那是甲骨文兄弟。我正在使用vb.net。谢谢这是相同的概念。如果模板是字符串,则可以像插入任何字符串一样插入。Oracle是一个数据库。VB.NET是一种语言。问题是我不知道怎么做。对不起,这里的新手。我投票决定结束,因为问题太广泛了。关于如何将数据插入MySQL数据库,有很多很多问题和答案。别误会。我认为您应该理解,如果您唯一的问题是如何将数据插入MySQL数据库,那么有多种方法可以在许多问题中解释。搜索将数据插入MySQL数据库。如果这不能回答问题,你将能够更好地表达一个更准确的问题。问题是我不知道怎么做。对不起,新手。