如何在c#中未聚焦(停用)的表单上全局挂接指纹扫描仪?

时间:2019-05-23 12:48:25

标签: c# .net c#-4.0 fingerprint digital-persona-sdk

在Verification Control中,当停用表单时,不会发生“完成时”事件。 This Fingerprint Sensor

就@nalnpir的评论而言,我知道表单必须在焦点上才能使DPFP工作,然后您应该问的问题是在不聚焦时或在此情况下如何全局挂接指纹扫描仪停用时的情况。这是问题,有什么办法可以克服这个限制?

private void verificationControl1_OnComplete(object Control, DPFP.FeatureSet FeatureSet,ref DPFP.Gui.EventHandlerStatus Status)
{
    DPFP.Verification.Verification ver = new DPFP.Verification.Verification();
    DPFP.Verification.Verification.Result res = new DPFP.Verification.Verification.Result();
    Models.UsersFingerPrint ufpData = null;
    bool breakit = false;
    // Compare feature set with all stored templates.
    foreach (var item in usersData)
    {
        foreach (DPFP.Template template in item.Value.templates)
        {
            // Get template from storage.
            if (template != null)
            {
                // Compare feature set with particular template.
                ver.Verify(FeatureSet, template, ref res);

                if (res.Verified)
                {
                    ufpData = item.Value;
                    breakit = true;
                    break; // success
                }
            }
        }
        if (breakit) break;
    }

    if (!res.Verified)
        Status = DPFP.Gui.EventHandlerStatus.Failure;
    else
    {
        database.updateUserLogin(ufpData.id);
        lblName.Text = ufpData.name + " " + ufpData.family;
        timer1.Start();
        //MessageBox.Show(ufpData.name+" "+ufpData.family+"\r\n"+ufpData.phoneNumber);
    }
}

更新:

this.verificationControl1.OnComplete += new DPFP.Gui.Verification.VerificationControl._OnComplete(this.verificationControl1_OnComplete);

0 个答案:

没有答案