Par*_*tte 5 c# sql biometrics digital-persona-sdk
Device : Digital Persona u.are.u 4500
Run Code Online (Sandbox Code Playgroud)
在注册时,我将数据以image格式保存在 sql 数据库中(sql 数据类型是图像)它工作正常我的数据正确保存在数据库中,但是现在当我在验证过程中验证数据时,它给出了异常
hresult : 0xffff.
Run Code Online (Sandbox Code Playgroud)
这是我用于验证的 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();
Run Code Online (Sandbox Code Playgroud)
我已经这样做了,它很有魅力!
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;
}
}
Run Code Online (Sandbox Code Playgroud)