private void Button1_Click_2(object sender, EventArgs e) { bool result; NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD(); m_NBioAPI.GetTextFIRFromHandle(m_hNewFIR, out m_textFIR, true); Console.WriteLine("verify " + m_textFIR.TextFIR); NBioAPI.Type.FIR_PURPOSE firpurpose; NBioAPI.Type.FIR_TEXTENCODE textencode = new NBioAPI.Type.FIR_TEXTENCODE(); bool result2; m_NBioAPI.GetTextFIRFromHandle(m_hNewFIR, out textencode, true); m_NBioAPI.VerifyMatch(textencode, textencode, out result2, null); uint gui = m_NBioAPI.VerifyMatch(textencode, textencode, out result, null); Console.WriteLine("resultado " + result2); if (result) { Console.WriteLine("ok"); } else { Console.WriteLine("notok"); } }
public Resultado <Digital, Falha> IdentificarDigital(byte[] digitalLida, Digital digitalParaComparar) { var encontrou = false; var payload = new NBioAPI.Type.FIR_PAYLOAD(); NBioAPI.Type.HFIR digitalLidaConvertida; _apiConversor.FDxToNBioBSPEx(digitalLida, (uint)digitalLida.Length, NBioAPI.Type.MINCONV_DATA_TYPE.MINCONV_TYPE_ISO, NBioAPI.Type.FIR_PURPOSE.ENROLL_FOR_IDENTIFICATION_ONLY, out digitalLidaConvertida); NBioAPI.Type.HFIR digitalParaCompararConvertida; _apiConversor.FDxToNBioBSPEx(digitalParaComparar.TemplateIso, (uint)digitalParaComparar.TemplateIso.Length, NBioAPI.Type.MINCONV_DATA_TYPE.MINCONV_TYPE_ISO, NBioAPI.Type.FIR_PURPOSE.ENROLL_FOR_IDENTIFICATION_ONLY, out digitalParaCompararConvertida); var retorno = _api.VerifyMatch(digitalLidaConvertida, digitalParaCompararConvertida, out encontrou, payload); if (encontrou) { var cbInfo = new NBioAPI.IndexSearch.CALLBACK_INFO_0(); NBioAPI.IndexSearch.FP_INFO[] informacaoBiometria; NBioAPI.IndexSearch.FP_INFO nitgenBiometria; var resultadoAddFir = _apiBusca.AddFIR(digitalLidaConvertida, (uint)digitalParaComparar.Id, out informacaoBiometria); retorno = _apiBusca.IdentifyData(digitalLidaConvertida, NBioAPI.Type.FIR_SECURITY_LEVEL.HIGHEST, out nitgenBiometria, cbInfo); var idEncontrado = nitgenBiometria.ID; _apiBusca.RemoveUser((uint)digitalParaComparar.Id); if (idEncontrado > 0) { return(digitalParaComparar); } } Debug.WriteLine($"digital {digitalParaComparar.Id}"); return(Falha.Nova(404, "Digital não encontrada")); }
private string CompararDigital(string Digital) { uint ret; bool result; NBioAPI m_NBioAPI = new NBioAPI(); NBioAPI.Type.HFIR hCapturedFIR = new NBioAPI.Type.HFIR(); NBioAPI.Type.FIR_TEXTENCODE m_textFIR = new NBioAPI.Type.FIR_TEXTENCODE(); NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD(); m_textFIR.TextFIR = Digital.ToString(); m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO); m_NBioAPI.Capture(out hCapturedFIR); ret = m_NBioAPI.VerifyMatch(hCapturedFIR, m_textFIR, out result, myPayload); if (result == true) { return("OK"); } else { return(""); } }
private dynamic buscar(dynamic dados) { JObject objJson; //string url = "http://localhost:3200/api/biometrico"; //var json = new WebClient().DownloadString(url); // dynamic m = JsonConvert.DeserializeObject( dados ); uint ret; bool result; NBioAPI m_NBioAPI = new NBioAPI(); NBioAPI.Type.HFIR hCapturedFIR = new NBioAPI.Type.HFIR(); NBioAPI.Type.FIR_TEXTENCODE m_textFIR = new NBioAPI.Type.FIR_TEXTENCODE(); NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD(); //m_textFIR.TextFIR = Digital.ToString(); m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO); m_NBioAPI.Capture(out hCapturedFIR); dynamic retorno = "-"; int idx = -1; int idxEncontrou = -1; foreach (dynamic obj in dados) { idx++; m_textFIR.TextFIR = obj.digital; ret = m_NBioAPI.VerifyMatch(hCapturedFIR, m_textFIR, out result, myPayload); if (result == true) { idxEncontrou = idx; break; } } if (idxEncontrou > -1) { string str1 = "{status: true, msg: 'Digital encontrada', indice: " + idxEncontrou + "}"; objJson = JObject.Parse(str1); return(objJson); } string str = "{status: false, msg: 'Digital não encontrada'}"; objJson = JObject.Parse(str); return(objJson); //return m; }
public Boolean ComparaFIR(String Text1, String Text2) { bool retorno; uint ret; NBioAPI.Type.FIR_TEXTENCODE texto1 = new NBioAPI.Type.FIR_TEXTENCODE(); texto1.TextFIR = Text1; NBioAPI.Type.FIR_TEXTENCODE texto2 = new NBioAPI.Type.FIR_TEXTENCODE(); texto2.TextFIR = Text2; NBioAPI.Type.FIR_PAYLOAD myPayload = new NBioAPI.Type.FIR_PAYLOAD(); ret = m_NBioAPI.VerifyMatch(texto1, texto2, out retorno, myPayload); return(retorno); }
public bool VerificarDigitais(String digitalCapturada, String digitaisSalvas) { bool resultado = false; NBioAPI.Type.FIR_TEXTENCODE salvas = ToFIR_TextEncode(digitaisSalvas); NBioAPI.Type.FIR_TEXTENCODE capturada = ToFIR_TextEncode(digitalCapturada); var payload = new NBioAPI.Type.FIR_PAYLOAD(); uint retorno = api.VerifyMatch(capturada, salvas, out resultado, payload); if (retorno == NBioAPI.Error.NONE) { return(resultado); } throw new Exception("Erro ao verificar digital: " + retorno); }