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. This function is the same as GetGeneralLogData except that interface names are different to achieve comp
Same as GetGeneralLogData
Return 1 if it is successful, return 0 if all records are read, or return a negative number if an error occurs.
GetGeneralLogData, GetGeneralLogDataStr
private void GetAllGLogData(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1) { //Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); int idwTMachineNumber = 0; int idwEnrollNumber = 0; int idwEMachineNumber = 0; int idwVerifyMode = 0; int idwInOutMode = 0; int idwYear = 0; int idwMonth = 0; int idwDay = 0; int idwHour = 0; int idwMinute = 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.GetAllGLogData(iMachineNumber, ref idwTMachineNumber, ref idwEnrollNumber, ref idwEMachineNumber, ref idwVerifyMode, ref idwInOutMode, ref idwYear, ref idwMonth, ref idwDay, ref idwHour, ref idwMinute))//get records from the memory { iGLCount++; MessageBox.Show("iGLCount: "+iGLCount.ToString()+ "idwEnrollNumber : "+idwEnrollNumber.ToString()+ "idwVerifyMode:" +idwVerifyMode.ToString()+ "idwInOutMode :" + idwInOutMode.ToString()+ "idwYear:" +idwYear.ToString() + " - " + idwMonth.ToString() + "-" + idwDay.ToString() + " " + idwHour.ToString() + ":" + idwMinute.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 Sub GetAllGLogData(Optional ByVal sIp As String = "10.0.0.44", Optional ByVal iPort As Integer = 4370, Optional ByVal iMachineNumber As Integer = 1) 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM Dim idwTMachineNumber As Integer Dim idwEnrollNumber As Integer Dim idwEMachineNumber As Integer 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 idwErrorCode As Integer Dim iGLCount = 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.GetAllGLogData(iMachineNumber, idwTMachineNumber, idwEnrollNumber, idwEMachineNumber, idwVerifyMode, idwInOutMode, idwYear, idwMonth, idwDay, idwHour, idwMinute) iGLCount += 1 MsgBox("iGLCount :" & iGLCount.ToString() & "idwEnrollNumber :" & idwEnrollNumber.ToString() & "idwVerifyMode:" & idwVerifyMode.ToString() & "idwInOutMode:" & idwInOutMode.ToString() & "idwYear:" & idwYear.ToString() & "-" + idwMonth.ToString() & "-" & idwDay.ToString() & " " & idwHour.ToString() & ":" & idwMinute.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