帮助 - 保存 DigitaPersona 模板文件。查看示例代码
用于保存 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这就是指纹模板的二进制数据,用于验证指纹。
您可以将其保存在数据库中的 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.