Biometric Reader

Biometric Reader

Postby Armando » Sat Jul 15, 2023 3:52 pm

Dear friends:

In a recent application, the client wants the user to identify himself in the LOGIN by his fingerprint.

Does the biometric reader work the same as a barcode reader?

Someone to give me a thread, or better, if you have a small example, it will be very grateful.

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Biometric Reader

Postby Antonio Linares » Sat Jul 15, 2023 4:35 pm

Dear Armando,

What biometric reader is it ? It should provide a SDK to be used

https://github.com/topics/fingerprint?l=c%2B%2B
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42117
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Biometric Reader

Postby csincuir » Sat Jul 15, 2023 5:01 pm

Hello Armando, at the time I used this biometric reader:
https://secugen.com/products/hamster-iv/
But overnight, because of Windows updates, it stopped working :cry:

But here I am sending you some examples so that you can get an idea of how the process worked:
    Read footprint: BioCapture()
    Enroll a footprint: BioEnroll()
    Verify a fingerprint: VerificaHuella()

Code: Select all  Expand view  RUN
///-------------------------------------------------------------------
FUNCTION BioCapture()     
Local oNBioBSP,  nDeviceId, cEnroll, lSecuGen

lSecuGen := .t.
    TRY
    oNBioBSP := CreateObject("SecuBSPMxCOM.APIInterface")
    CATCH
      lSecuGen := .f.
    END 
   
   
    IF !lSecuGen
       MsgAlert( "No esta instalado el lector de huella","Verifique por favor..." )
   
       oNBioBSP := NIL
       Return ""
    End


IF lSecuGen

   oNBioBSP:EnumerateDevice()
   
   nDeviceId := oNBioBSP:DeviceNum() //Numero de Dispositivos
   If Empty( nDeviceId )
      MsgAlert("No esta conectado el Lector Biometrico en su equipo...","Verifique por favor..." )
      oNBioBSP := NIL
      Return ""   
   End
   
   nDeviceId := oNBioBSP:DeviceID(0)

   oNBioBSP:OpenDevice( nDeviceId )
   
   oNBioBSP:Capture()
   cEnroll := ""
   If oNBioBSP:ErrorCode == 0
      cEnroll := oNBioBSP:FIRTextData()
   EndIf
   oNBioBSP:CloseDevice( nDeviceId )

   oNBioBSP := NIL

   Return( cEnroll )
End


Return( "" )



///-------------------------------------------------------------------
FUNCTION BioEnroll()       
Local oNBioBSP, oDevice, nDeviceId, cEnroll, oExt, oMatch
Local oEnroll, oCapture, oExtra, oTemp, oVEr, lOk, hLib, lSecuGen

lOk := .T.
TRY
   oNBioBSP:=CreateObject('MyDll.Suma')
   cEnroll := AllTrim( oNBioBSP:Enroll() )
CATCH
  lOk := .f.
END
    IF !lOk
       MsgAlert( "No esta instalado el lector de huella","Verifique por favor..." )
   
       oNBioBSP := NIL
       Return ""
    End

Return( cEnroll )  

lSecuGen := .f.

lOk := .T.
TRY
oNBioBSP := CreateObject("NBioBSPCOM.NBioBSP")
CATCH
  lOk := .f.
END

If !lOk
    lSecuGen := .t.
    TRY
    oNBioBSP := CreateObject("SecuBSPMxCOM.APIInterface")
    CATCH
      lSecuGen := .f.
    END
    IF !lSecuGen
       MsgAlert( "No esta instalado el lector de huella","Verifique por favor..." )
   
       oNBioBSP := NIL
       Return ""
    End
End

IF lSecuGen
   oNBioBSP:EnumerateDevice()
   
   nDeviceId := oNBioBSP:DeviceNum() //Numero de Dispositivos
   If Empty( nDeviceId )
      MsgAlert("No esta conectado el Lector Biometrico en su equipo...","Verifique por favor..." )
      oNBioBSP := NIL
      Return ""   
   End
   
   nDeviceId := oNBioBSP:DeviceID(0)

   oNBioBSP:OpenDevice( nDeviceId )
   
   oNBioBSP:Enroll(NIL)
   cEnroll := ""
   If oNBioBSP:ErrorCode == 0
      cEnroll := oNBioBSP:FIRTextData()
   EndIf
   oNBioBSP:CloseDevice( nDeviceId )

   oNBioBSP := NIL
   
   Return( cEnroll )
End

lOk := .T.
TRY
   oDevice := oNBioBSP:Device()
CATCH
  lOk := .f.
END

If !lOk
   MsgAlert( "No esta instalado el lector de huella","Verifique por favor..." )
   oNBioBSP := NIL
   Return ""
End

oDevice:Enumerate()

nDeviceId := oDevice:EnumDeviceID( 0 )

oDevice:Open( nDeviceID )

oExt := oNBioBSP:Extraction()

cEnroll := ""
oExt:Enroll( cEnroll )
cEnroll :=  oExt:TextEncodeFIR()


oDevice:Close( nDeviceID )

oNBioBSP := 0

Return( cEnroll )


///-------------------------------------------------------------------
FUNCTION VerificaHuella(lVer,cUser,cHuella)   
Local cEnroll1, cEnroll2, cSql, nRet, cUser

DEFAULT lVer := .f.

If lVer
   If Empty(cUser)
      MsgAlert( "No ingreso el ID del Usuario...","Verifique por favor..." )
      Return ""    
   End
Else
    cUser:=Space(40)
    _MsgGet( " Verificando...","Usuario:",@cUser )

    If Empty( cUser )
       MsgAlert( "No ingreso el ID del Usuario...","Verifique por favor..." )
       Return ""
    End

End 

cSql := "SELECT huellatxt FROM usuarios WHERE usuario='"+allTrim(cUser)+"'"
cEnroll1 := cHuella
If Empty( cEnroll1 )
   IF lVer
      MsgAlert( "El Usuario actual no tiene definida su Impresion Digital...","Verifique por favor..." )
      Return .f.
   End
   MsgAlert( "El Usuario ingresado no tiene definida su Impresion Digital...","Verifique por favor..." )
   Return ""
End
   
cEnroll2 := BioCapture()       
If Empty( cEnroll2 )
   If lVer
      Return .f.
   End
   Return ""
End

nret := BioVerify( cEnroll1, cEnroll2 ) 
If nRet == 0
   MsgAlert( "La Impresion Digital ingresada no Coincide con la del Usuario: "+cUser,"Verifique por favor..." )
   If lVer
      Return .f.
   End
   cUser := ""
End
If lVer
   Return .t.
End

Return cUser
 


Best regards.

Carlos
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Biometric Reader

Postby Armando » Sat Jul 15, 2023 5:04 pm

Antonio firend:

The biometric reader has not been purchased yet, I am just starting to investigate what I need,
so any advice or suggestion is welcome

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Biometric Reader

Postby Armando » Sat Jul 15, 2023 5:28 pm

Friend Carlos:

Your example is a very valuable help, I will review it, thank you very much

The biometric reader includes some DLL

Best regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3229
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Biometric Reader

Postby csincuir » Mon Jul 17, 2023 12:33 pm

Yes Armando,
In the request-free-software downloads option on the company's website, you can download the SDK for Windows:
https://secugen.com/request-free-software/

Best regards.

Carlos.
csincuir
 
Posts: 408
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests