Sie sind auf Seite 1von 4

Dim WithEvents op As FPRegisterTemplate Dim cursample As Integer Dim register As FPTemplate Private Sub Save_and_Load_Verify_Form() Dim bvariant As Variant

blob_write = Null bvariant = Null If register Is Nothing Then lblEvents.Caption = "" MsgBox "Nothing Registered !!" Exit Sub End If register.Export bvariant blob_write = bvariant rs.AddNew rs("employee_name") = eName.Text rs("employee_fp") = blob_write rs.Update reslt = MsgBox("Performmore registerations !! ? ", vbYesNo, "More Regist rations ?") If reslt = 6 Then eName.Text = "" eName.Refresh Label3.Caption = "Before Putting finger on the senser - Enter New Name -> " Label3.Refresh Call start_cmd_Click Else Load frmVerify End If End Sub Private Sub Command1_Click() Load frmVerify End Sub Private Sub Form_Load() If cnx Is Nothing And rs Is Nothing Then Set cnx = New Connection Set rs = New Recordset End If cnx.Open "sdb", "", "" rs.Open "select * from empl", cnx, adOpenKeyset, adLockOptimistic cursample = 0 Set op = New FPRegisterTemplate For i = 0 To 3 picSample(i).Picture = Nothing Label6(i).Visible = False Next i End Sub Private Sub op_Done(ByVal pTemplate As Object) lblEvents.Caption = ""

Set register = Nothing Set register = pTemplate MsgBox "Registration Process is Done. The system is now going export temp late in empl.mdb database" Call Save_and_Load_Verify_Form End Sub Private Sub op_SampleQuality(ByVal Quality As DpSdkEngLib.AISampleQuality) Select Case Quality Case AISampleQuality.Sq_Good lblQuality.Caption = "OK" cursample = cursample + 1 Label6(cursample - 1).Visible = False If cursample <> 4 Then Label6(cursample).Visible = True End If Case AISampleQuality.Sq_LowContrast lblQuality.Caption = "" Case AISampleQuality.Sq_NoCentralRegion lblQuality.Caption = "" Case AISampleQuality.Sq_None lblQuality.Caption = "" Case AISampleQuality.Sq_NotEnoughFtr lblQuality.Caption = "" ' Case AISampleQuality.Sq_TooDark lblQuality.Caption = "" Case AISampleQuality.Sq_TooLight lblQuality.Caption = "" Case AISampleQuality.Sq_TooNoisy lblQuality.Caption = "" End Select lblEvents.Caption = "" End Sub Private Sub op_SampleReady(ByVal pSample As Object) If cursample < 3 Then Label3.Caption = "Yes, put your finger again on the sensor to acquir e sample #" & Str(cursample + 1) Label3.Refresh Else Label3.Caption = "Wait for the Verify form" Label3.Refresh Me.MousePointer = 2 End If pSample.PictureOrientation = Or_Portrait pSample.PictureWidth = picSample(cursample).Width / Screen.TwipsPerPixel X pSample.PictureHeight = picSample(cursample).Height / Screen.TwipsPerPix elY picSample(cursample).Picture = pSample.Picture lblEvents.Caption = "Sample ready" End Sub Private Sub picSample_Click(Index As Integer) Dim i As Integer cursample = 0 For i = 0 To 3 picSample(i).Picture = Nothing Label6(i).Visible = False

Next i Label6(cursample).Visible = True Set op = Nothing Set op = New FPRegisterTemplate op.Run lblQuality.Caption = "" lblEvents.Caption = "" End Sub Private Sub start_cmd_Click() eName.Text = "" eName.Refresh Label3.Caption = "Before Putting finger on the sensor - Enter New Name -> " Label3.Refresh picSample_Click (0) End Sub

to verify, you need another form

Private WithEvents op As FPGetTemplate Dim tp As FPTemplate Dim cnx1 As New Connection Dim rs1 As New Recordset Dim vp As FPVerify Dim nStartTimer As Single Dim nEndTimer As Single Private Sub Command1_Click() If tName.Text = "" Then MsgBox "Enter user name " Exit Sub End If If op Is Nothing Then Set op = New FPGetTemplate End If op.Run End Sub Private Sub Form_Load() frmVerify.Show 1 End Sub Private Sub Form_Unload(Cancel As Integer) rs.Close cnx.Close Set op = Nothing Set vp = Nothing End Sub Private Sub op_Done(ByVal pTemplate As Object) Set tp = pTemplate Dim rp As FPTemplate

Set op = New FPGetTemplate Set vp = New FPVerify Dim result As Boolean Dim strHex, strTemp As String Dim rno As Integer rno = 1 result = False rs.Find "employee_name = '" + tName.Text + "'" If rs.EOF = False Then blob_read = rs("employee_fp") varnt = blob_read Set rp = New FPTemplate er = rp.Import(varnt) re = vp.Compare(rp, pTemplate, result, src, thsh, False, Sm_None) Set rp = Nothing End If If result = True Then Label1.Caption = "Passed !!! Finger prints matched " Label1.Refresh MsgBox "Finger print matched : " + rs("employee_name") Else Label1.Caption = "Failed !!! Finger prints NOT matched" Label1.Refresh MsgBox "No finger print match found !" End If Set rp = Nothing Set op = Nothing Set vp = Nothing End Sub Private Sub op_SampleReady(ByVal pSample As Object) pSample.PictureOrientation = Or_Portrait pSample.PictureWidth = Picture1.Width / Screen.TwipsPerPixelX pSample.PictureHeight = Picture1.Height / Screen.TwipsPerPixelY Picture1 = pSample.Picture End Sub

Das könnte Ihnen auch gefallen