gpt4 book ai didi

c# - 来自数据库的 Digital Persona 指纹验证不起作用

转载 作者:行者123 更新时间:2023-11-30 12:40:27 27 4
gpt4 key购买 nike

   Device  :  Digital Persona u.are.u 4500 

注册时我将数据保存在 sql 数据库中 image 格式(sql 数据类型是图像)它工作正常我的数据正确保存在数据库中,但是现在当我验证数据时在我的验证过程中它给出了异常

hresult : 0xffff.

这是我的C#验证代码

SqlConnection conn = new SqlConnection(connetionstring);
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM mySavedDataTable", conn);
MemoryStream ms;
byte[] fpBytes;
SqlDataAdapter sd = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sd.Fill(dt);

foreach (DataRow dr in dt.Rows)
{
fpBytes = Encoding.UTF8.GetBytes(dr["Template"].ToString());
ms = new System.IO.MemoryStream(fpBytes);
DPFP.Template template = new DPFP.Template();
template.Serialize(ms);
Verificator.Verify(features, template, ref result);
if (result.Verified)
{
ver = true;
break;
}
}
conn.Close();

最佳答案

我已经这样做了,而且效果很好!

DataResult<Fmd> resultConversion = null;
IdentifyResult identifyResult = null;
string MobileNumber = "";
string Cnic = "";

// Check capture quality and throw an error if bad.
if (!this.CheckCaptureResult(captureResult)) return;
// See the SDK documentation for an explanation on threshold scores.
int thresholdScore = DPFJ_PROBABILITY_ONE * 1 / 100000;
DataSet dataSetBiometric = DatabaseHandler.getData("select CNIC, MOBILE_NUMBER, BIOMETRIC from ACCOUNT_OPENING");
//select CNIC, MOBILE_NUMBER, BIOMETRIC from ACCOUNT_OPENING
Fmd[] fmds = new Fmd[dataSetBiometric.Tables[0].Rows.Count];
for (int i = 0; i < dataSetBiometric.Tables[0].Rows.Count; i++)
{
fmds[0] = Fmd.DeserializeXml(dataSetBiometric.Tables[0].Rows[i]["BIOMETRIC"].ToString());//BIOMETRIC
resultConversion = FeatureExtraction.CreateFmdFromFid(captureResult.Data, Constants.Formats.Fmd.ANSI);
identifyResult = Comparison.Identify(resultConversion.Data, 0, fmds, thresholdScore, dataSetBiometric.Tables[0].Rows.Count);
if (identifyResult.ResultCode == Constants.ResultCode.DP_SUCCESS)
{
MobileNumber = dataSetBiometric.Tables[0].Rows[i]["MOBILE_NUMBER"].ToString();
Cnic = dataSetBiometric.Tables[0].Rows[i]["CNIC"].ToString();
break;
}
}

关于c# - 来自数据库的 Digital Persona 指纹验证不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41742993/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com