帮助 - 保存 DigitaPersona 模板文件。查看示例代码

发布于 2024-09-30 14:14:51 字数 2582 浏览 4 评论 0原文

用于保存 DigitaPersona 模板串行数据的 DELPHI 5 示例 至 DBASE4 DBF 文件。

procedure TFormEnroll.DPFPEnrollmentControl1Enroll(Sender: TObject;
  lFingerMask: Integer; const pTemplate, pStatus: IDispatch);
var
  MMask : Integer;
  Template : IDispatch;
  MTempStr : OleVariant;

  lByteArray: Variant;
  lArrayPointer: Pointer;
  lStr: AnsiString;
  DPFPTemplate: TDPFPTemplate;
  aRawData : Variant;
begin
  aRawData := pTemplate;
  lStr := aRawData.Serialize;
  MMask := lFingerMask;
  if lStr = null then
    StatusBar.Panels.Items[0].Text := 'The fingerprint TEMPLATE is empty! + Mask=' + IntToStr(MMask)
  else
    StatusBar.Panels.Items[0].Text := 'The fingerprint TEMPLATE has something! + Mask=' + IntToStr(MMask);
  MMsg := lStr;
  MLen := Length(MMsg);
  EditSerialData.Text := MMsg;
  MemoSerialData.Lines.Text := MMsg;
  MemoSerialData2.Lines.Text := MMsg;
  EditLenSerialData.Text := IntToStr(MLen);
  EditFingerMask.Text := IntToStr(DPFPEnrollmentControl1.EnrolledFingersMask);
  //Update database - Take to separate save button
  DMForm.Finger.First;
  if DMForm.Finger.State in [dsEdit, dsInsert] then
    // do nothing
  else
    DMForm.Finger.Edit;
  DMForm.FingerUSERNAME.Value := 'Testing ';
  DMForm.Finger.Post;
  DMForm.Finger.Edit;
  DMForm.FingerUSERNAME.Value := 'Testing ' + IntToStr(DMForm.FingerFINGERID.Value);
  DMForm.FingerFINGERTEMP.Value := MMsg;
  DMForm.FingerEnrolledFingerMask.Value := IntToStr(DPFPEnrollmentControl1.EnrolledFingersMask);
  DMForm.FingerFingerSerialData.Value := MMsg;
  DMForm.Finger.Post;
end;

保存模板的示例字符串 = "?b???????????????????????????????????? ???????????????????????????????????????????????? ??+??????[???????????????V????????????????????? ?????????????????????????????????????????????9?????? ??????o???????????????????????????????????????????????? ??????????????????????????????????????????????????? ??????????????????????????????????????????????????? ????????????????????????j?????????????????????o ??????????????????????????????????????????????????? ??????U·????????????????????????????????????????????? ??????????????????????????????????????????????????? ??????????????????????????????????????????????????? ???????????????????????????????????????#???????????? ??????????????????????????????????????????????????? ??????????????????????????????????????????????????? ??????????????????????????????????????????????????? ???????????????????????????”

这是我们所期望的结果吗? 这是一个可行的模板吗? 您能否解释一下(aRawData := pTemplate;) 'aRawData'(它是一个变体)与'pTemplate;)'(这是一个调度变量)的交互。 我在写路径上吗?

DELPHI 5 SAMPLE FOR SAVING A DigitaPersona TEMPLATE SERIAL DATA
TO A DBASE4 DBF FILE.

procedure TFormEnroll.DPFPEnrollmentControl1Enroll(Sender: TObject;
  lFingerMask: Integer; const pTemplate, pStatus: IDispatch);
var
  MMask : Integer;
  Template : IDispatch;
  MTempStr : OleVariant;

  lByteArray: Variant;
  lArrayPointer: Pointer;
  lStr: AnsiString;
  DPFPTemplate: TDPFPTemplate;
  aRawData : Variant;
begin
  aRawData := pTemplate;
  lStr := aRawData.Serialize;
  MMask := lFingerMask;
  if lStr = null then
    StatusBar.Panels.Items[0].Text := 'The fingerprint TEMPLATE is empty! + Mask=' + IntToStr(MMask)
  else
    StatusBar.Panels.Items[0].Text := 'The fingerprint TEMPLATE has something! + Mask=' + IntToStr(MMask);
  MMsg := lStr;
  MLen := Length(MMsg);
  EditSerialData.Text := MMsg;
  MemoSerialData.Lines.Text := MMsg;
  MemoSerialData2.Lines.Text := MMsg;
  EditLenSerialData.Text := IntToStr(MLen);
  EditFingerMask.Text := IntToStr(DPFPEnrollmentControl1.EnrolledFingersMask);
  //Update database - Take to separate save button
  DMForm.Finger.First;
  if DMForm.Finger.State in [dsEdit, dsInsert] then
    // do nothing
  else
    DMForm.Finger.Edit;
  DMForm.FingerUSERNAME.Value := 'Testing ';
  DMForm.Finger.Post;
  DMForm.Finger.Edit;
  DMForm.FingerUSERNAME.Value := 'Testing ' + IntToStr(DMForm.FingerFINGERID.Value);
  DMForm.FingerFINGERTEMP.Value := MMsg;
  DMForm.FingerEnrolledFingerMask.Value := IntToStr(DPFPEnrollmentControl1.EnrolledFingersMask);
  DMForm.FingerFingerSerialData.Value := MMsg;
  DMForm.Finger.Post;
end;

EXAMPLE STRING OF THE SAVED TEMPLATE = "?b?????????????????????????????????????????????????????õ???????????????????????????????????+???????[??????????????????V????????????????????????????????????????????????????????????????9??????????o??????????????????????????????????????????????????????????????????¦???????????????????????????????????????????????????????????????????????????????????????????????????????j??????????????????????o????????????????????????????????????????????????????????U·?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????#??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????"

Is this the kind of result we expect?
Is this a workable template?
Can you explain ( aRawData := pTemplate;) the interaction of 'aRawData' which is a variant with 'pTemplate;) ' which is a Dispatch variable.
Am I on the write path?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮坠入山谷 2024-10-07 14:14:51

是的,这就是指纹模板的二进制数据,用于验证指纹。

您可以将其保存在数据库中的 blob 中或二进制文件中并加载它,或者保存到 bintohex 中并将其保存在文本文件中。

模板和原始数据之间的区别在于,模板是用于在下次将手指按在读取器中时验证手指的模板。如果打印出原始数据,您会发现它要大得多。

看起来您的方向是正确的,只需不用担心二进制数据即可。

Yeah, that's the binary data of the fingerprint template which is used to verify the fingerprint.

You can save it in a blob in a database or a binary file and load it or to bintohex and save it in a text file.

The difference between a template and the rawdata is that the template is the one that is used to verify the finger the next time it is pressed in the reader. You'll see that if you print out the rawdata that it's a lot bigger.

Looks like you're on the right track, just don't worry about the binary data.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文