Mwas Waituru
Mwas Waituru

Reputation: 21

saving zkfinger fingerprint template vb.net

I am trying to save a fingerprint template. My code below creates the file but doesn't write anything to it. How can I fix this? The main problem is in setting the template length

Imports ZKFPEngXControl 'import the  zkfinger controll sdk

Public Class Form1
    Dim fp As New ZKFPEngX 'create a new ZKFPEngX object
    Public otemplate As Object
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        fp.SensorIndex = 0 'initiate the sensor
        If (fp.InitEngine = 0) Then 'check if sensor is contected
            MsgBox("connected", , "status") 'inform user if connection is succesfull
        Else
            MsgBox("not connected", , "status") 'inform user if connection failed
        End If
    End Sub
    Protected Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        otemplate = New Runtime.InteropServices.UnknownWrapper(Nothing)
        fp.SetTemplateLen(otemplate, 602)
        fp.SaveTemplate("D:\n\3.tpl", otemplate)
        MsgBox("saved", , "status") 'info user finger print is saved
    End Sub
End Class

Upvotes: 1

Views: 2500

Answers (1)

Mwas Waituru
Mwas Waituru

Reputation: 21

figured out why .....code below saves the correct templates

fp.BeginCapture()
        vtemplate = fp.GetTemplate()
        fp.SaveTemplate("D:\n\2.tpl", vtemplate)
        fp.CancelCapture()

Upvotes: 1

Related Questions