保存zkfinger指纹模板vb.net

时间:2015-08-18 12:33:10

标签: vb.net

我正在尝试保存指纹模板。我下面的代码创建了文件,但没有写任何内容。我怎样才能解决这个问题?主要问题是设置模板长度

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

1 个答案:

答案 0 :(得分:0)

弄清楚为什么......下面的代码会保存正确的模板

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