Biometrics Fingerprint is giving somebody else's information

906 views Asked by At

I have this Biometrics, but it gives me the completely wrong output - the different userid and the verify date at year 2132.

What can be causing such wrong information? I couldn't find any similar problem on Internet. Does anyone else have encountered the same problem like mine?


C# Code:

            if (axCZKEM1.ReadGeneralLogData(GetMachineNumber()))
        {
            while (axCZKEM1.SSR_GetGeneralLogData(GetMachineNumber(), out sdwEnrollNumber, out idwVerifyMode,
                        out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkcode))//get records from the memory
            {
                DataRow dr = dt_log.NewRow();
                dr["User ID"] = sdwEnrollNumber;
                dr["Verify Date"] = idwYear + "-" + idwMonth + "-" + idwDay + " " + idwHour + ":" + idwMinute + ":" + idwSecond;
                dr["Verify Type"] = idwVerifyMode;
                dr["Verify State"] = idwInOutMode;
                dr["WorkCode"] = idwWorkcode;
                dt_log.Rows.Add(dr);
            }
            ret = 1;
        }
        else
        {
            axCZKEM1.GetLastError(ref idwErrorCode);
            ret = idwErrorCode;

            if (idwErrorCode != 0)
            {
                lblOutputInfo.Items.Add("*Read attlog failed,ErrorCode: " + idwErrorCode.ToString());
            }
            else
            {
                lblOutputInfo.Items.Add("No data from terminal returns!");
            }
        }

VB.NET Code:

If axCZKEM1.ReadGeneralLogData(iMachineNumber) Then

            While axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, idwEnrollNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute, idwSecond, idwWorkCode)

                Dim newitem As New ListViewItem()

                    newitem.Text = idwEnrollNumber.ToString()
                    newitem.SubItems.Add(idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString())
                    newitem.SubItems.Add(idwVerifyMode.ToString)
                    newitem.SubItems.Add(idwInOutMode.ToString)
                    newitem.SubItems.Add(idwWorkCode.ToString)
                    lvLogs.Items.Add(newitem)

            End While
  End If

Device Model : MA300

Device Type : Access Control


enter image description here

2

There are 2 answers

0
Audy On

The date and time at machine must be wrong.

0
David On

That is not how you should construct DateTime objects. Try using this constructor to construct the DateTime object and then calling ToString with your desired format. If that fails then you can rule out that :

newitem.SubItems.Add(New DateTime(idwYear, idwMonth, idwDay, idwHour, idwMinute, idwSecond).ToString("yyyy-MM-dd hh:mm:ss"))

I would also suggest setting up a breakpoint when constructing the DateTime object and inspect the values of idwYear/Month/etc. to make sure that the referenced variables have the expected values.

I double-checked the documentation for this method and it looks like the signature is correct. I would also recommend checking that your variables are declared as Integer variables (just to make certain).