Read attendance records and write them into the internal buffer of the PC. This function is the same as ReadAllGLogData.
Device number
Return True if it is successful, or return False.
ReadAllGLogData, GetAllGLogData, GetGeneralLogData, GetGeneralLogDataStr, ClearGLog, GetGeneralExtLogData
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