Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I know my question may be funny. I use this function to identify registered fingerprint in database and this function is for the fingerprint sensor of "zkteco" company. This function is like this:

[Function]
  public static int DBIdentify(IntPtr dbHandle, byte[] temp, ref int fid, ref int score)
[Purpose]
  This function is used to conduct 1:N comparison.
[Parameter Description]
 dbHandle
  Cache handle
temp
  Template used for comparison
fid
  Returned fingerprint ID
score
  Returned comparison score
[Return Value]
  0 Succeeded
  Others Failed (See the error code description.)


My problem is with this IntPtr dbHandle.
Please let me explain more, I am going to use this method to identify the fingerprint registered in the database, but I don't know how to put my database information in this temporary variable IntPtr dbHandle.

What I have tried:

I get the registered fingerprint string from my database with this:
C#
int ret = zkfp.ZKFP_ERR_OK;
string RegTemplate;
int fid = 0, score = 0;
 foreach (DataGridViewRow item in dataGridView1.Rows)
 {
  try
    {

    RegTemplate = item.Cells[0].Value.ToString();
    byte[] FinalRegTemplate = zkfp2.Base64ToBlob(RegTemplate);
    ret = zkfp2.DBIdentify(mDBHandle, FinalRegTemplate, ref fid, ref score);
      }
     catch
        {}


Quote:
And my problem is with the first parameter of the "DBIdentify" function.
Because the first parameter does not accept string

and I want to give it to the IntPtr dbHandle, but the variable does not accept the string and I don't know how to convert it and put it in this function:
C#
public static int DBIdentify(IntPtr dbHandle, byte[] temp, ref int fid, ref int score)
Posted
Updated 19-Sep-23 10:21am
v3

1 solution

I don't know anything about your fingerprint system but it seems clear that it has an associated database. You have to open that database (or connect to it, or whatever terminology they use). To do that you will have to call a function, maybe with credentials or other parameters, and you will get back the dbHandle you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900