Read attendance records one by one from the internal buffer. Before using this function, you can use ReadAllGLogData or ReadGeneralLogData to read attendance records from the device and write them into the internal buffer of the PC. Each time this function is executed, the pointer points to the next attendance record.
Device number
Pointer pointing to a BSTR variable. The value is the user ID of the received attendance record. The value consists of up to 24 bits.
Pointer pointing to a long variable. The value is the verification mode of the received attendance record. The values are as follows: Generally, 0: password verification, 1: fingerprint verification, 2: card verification. In multi-verification mode: FP_OR_PW_OR_RF 0 FP 1 PIN 2 PW 3 RF 4 FP_OR_PW 5 FP_OR_RF 6 PW_OR_RF 7 PIN_AND_FP 8 FP_AND_PW 9 FP_AND_RF 10 PW_AND_RF 11 FP_AND_PW_AND_RF 12 PIN_AND_FP_AND_PW 13 FP_AND_RF_OR_PIN 14
Pointer pointing to a long variable. The value is the AttState of the received attendance record. The values are as follows: 0—Check-In (default value) 1—Check-Out 2—Break-Out 3—Break-In 4—OT-In 5—OT-Out
Pointers pointing to long variables. The values are the date and time of the received attendance record.
Pointer pointing to a long variable. The value is the work code of the received attendance record.
Return True if it is successful, or return False.
ReadGeneralLogData
private static void SSR_GetGeneralLogData(string sIp = "10.0.0.44", int iPort = 4370) { //Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); int iMachineNumber = 1; axCZKEM1.Connect_Net(sIp, iPort); string sdwEnrollNumber = ""; int idwVerifyMode = 0; int idwInOutMode = 0; int idwYear = 0; int idwMonth = 0; int idwDay = 0; int idwHour = 0; int idwMinute = 0; int idwSecond = 0; int idwWorkcode = 0; int idwErrorCode = 0; int iGLCount = 0; int iIndex = 0; axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory { while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, 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 { iGLCount++; MessageBox.Show("LCount :" + iGLCount.ToString() + " | " + "EnrollNumber :" + sdwEnrollNumber.ToString() + " | " + //modify by Darcy on Nov.26 2009 "VerifyMode: " + idwVerifyMode.ToString() + " | " + "InOutMode: " + idwInOutMode.ToString() + " | " + "Year: " + idwYear.ToString() + "-" + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.ToString() + ":" + idwSecond.ToString() + " | " + "Workcode: " + idwWorkcode.ToString() ); iIndex++; } } else { axCZKEM1.GetLastError(ref idwErrorCode); if (idwErrorCode != 0) { MessageBox.Show("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString(), "Error"); } else { MessageBox.Show("No data from terminal returns!", "Error"); } } axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device } }
Private Shared Sub SSR_GetGeneralLogData(Optional ByVal sIp As String = "10.0.0.44", Optional ByVal iPort As Integer = 4370) 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM Dim iMachineNumber As Integer axCZKEM1.Connect_Net(sIp, iPort) Dim sdwEnrollNumber As String = "" Dim idwVerifyMode As Integer Dim idwInOutMode As Integer Dim idwYear As Integer Dim idwMonth As Integer Dim idwDay As Integer Dim idwHour As Integer Dim idwMinute As Integer Dim idwSecond As Integer Dim idwWorkcode As Integer Dim idwErrorCode As Integer Dim iGLCount = 0 Dim lvItem As New ListViewItem("Items", 0) axCZKEM1.EnableDevice(iMachineNumber, False) 'disable the device If axCZKEM1.ReadGeneralLogData(iMachineNumber) Then 'read all the attendance records to the memory 'get records from the memory While axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, sdwEnrollNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute, idwSecond, idwWorkcode) iGLCount += 1 MsgBox("LCount :" & iGLCount.ToString() & " | " & "EnrollNumber :" & sdwEnrollNumber.ToString() & " | " & ' modify by Darcy on Nov.26 2009 "VerifyMode: " & idwVerifyMode.ToString() & " | " & "InOutMode: " & idwInOutMode.ToString() & " | " & "Year: " & idwYear.ToString() & "-" & idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.ToString() & ":" & idwSecond.ToString() & " | " & "Workcode: " & idwWorkcode.ToString() ) End While Else axCZKEM1.GetLastError(idwErrorCode) If idwErrorCode <> 0 Then MsgBox("Reading data from terminal failed,ErrorCode: " & idwErrorCode, MsgBoxStyle.Exclamation, "Error") Else MsgBox("No data from terminal returns!", MsgBoxStyle.Exclamation, "Error") End If End If axCZKEM1.EnableDevice(iMachineNumber, True) 'enable the device End Sub