void AxZKFPEngX1_OnEnroll(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnEnrollEvent e) { Selection Selection = this.treeView1.SelectedNode.Parent.Parent.Tag as Selection; BioKeyInfo BioKeyInfo = new BioKeyInfo(); BioKeyInfo.RegisterID = Guid.NewGuid().ToString(); BioKeyInfo.RegisterName = this.treeView1.SelectedNode.Text; BioKeyInfo.Template = e.aTemplate; BioKeyInfo.UserCode = this.treeView1.SelectedNode.Name; BioKeyInfo.RalationID = Selection.ID; if (CaijiKeyHelper.IsExist(BioKeyInfo.UserCode)) { MessageBox.Show("指纹已经存在!"); return; } Boolean Result = CaijiKeyHelper.SaveRegister(BioKeyInfo); if (Result) { MessageBox.Show("指纹登记成功"); } else { MessageBox.Show("指纹登记失败"); } }
private void BioKeyRegisterForm_Load(object sender, EventArgs e) { if (AxZKFPEngX1.InitEngine() != 0) { MessageBox.Show("指纹仪初始化失败"); } CaijiKeyHelper.Init(this.treeView1); }
void AxZKFPEngX1_OnCapture(object sender, AxZKFPEngXControl.IZKFPEngXEvents_OnCaptureEvent e) { try { List <BioKeyInfo> BioKeyInfos = new List <BioKeyInfo>(); BioKeyInfos = CaijiKeyHelper.GetTemplates(this.UserCode); if (BioKeyInfos != null) { foreach (BioKeyInfo BioKeyInfo in BioKeyInfos) { bool b = false; Object obj = BioKeyInfo.Template; if (!IsEnd) { if (AxZKFPEngX1.VerFinger(ref obj, e.aTemplate, false, ref b)) { IsEnd = true; this.label1.Text = ""; this.richTextBox1.SelectedText += "指纹对比通过" + "\r\n"; this.richTextBox1.SelectedText += "当前监理见证人为:" + BioKeyInfo.RegisterName; MessageBox.Show("指纹对比通过,当前监理见证人为:" + BioKeyInfo.RegisterName); this.Name = BioKeyInfo.RegisterName; this.DialogResult = DialogResult.OK; break; } } } if (!IsEnd) { this.richTextBox1.SelectedText += "指纹对比不通过,请重新输入指纹!" + "\r\n"; } } else { this.richTextBox1.SelectedText += "读取服务器指纹记录失败,请重新输入指纹!" + "\r\n"; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }