private unsafe void btnmach_Click(object sender, EventArgs e) { int n = FingerPrintHelper.PSGetImage(pHandle, nAddr); if (n == (int)ReturnValue.PS_OK) { richtxt_log.AppendText("获取指纹成功\n"); //生成字符文件 if (FingerPrintHelper.PSGenChar(pHandle, nAddr, 1) == (int)ReturnValue.PS_OK) { richtxt_log.AppendText("字符文件填充到BufferA成功\n"); iScore = 0; if (FingerPrintHelper.PSMatch(pHandle, nAddr, out iScore) == (int)ReturnValue.PS_OK) { richtxt_log.AppendText("比对成功\n"); byte[] data = new byte[512]; fixed(byte *arry = data) { int length = 0; if (FingerPrintHelper.PSUpChar(pHandle, nAddr, iBufferID, arry, out length) == (int)ReturnValue.PS_OK) { string hexStr = FingerPrintHelper.ToHexString(data); richtxt_log.AppendText(string.Format("匹配分数{0}\n", iScore)); richtxt_log.AppendText(string.Format("{0}\n", hexStr)); if (FingerPrintHelper.PSEmpty(pHandle, nAddr) == ReturnValue.PS_OK.ToInt()) { richtxt_log.AppendText("清除闪存指纹libaray成功\n"); } } } } } } }
private void Test_Load(object sender, EventArgs e) { //连接指纹 if (FingerPrintHelper.PSOpenDeviceEx(out pHandle, 2, 1) == ReturnValue.PS_OK.ToInt()) { //this.label1.Text = "连接成功"; richtxt_log.AppendText("指纹连接成功\n"); if (FingerPrintHelper.PSEmpty(pHandle, nAddr) == ReturnValue.PS_OK.ToInt()) { richtxt_log.AppendText("清除闪存指纹libaray成功\n"); } } }