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
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
///-------------------------------------------------------------------
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