GetGeneralLogDataStr

Definition

Usage

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. The difference between this function and GetGeneralLogData is the returned time type.

Parameter

Device number

Pointer pointing to a long variable. The value is the user ID of the received attendance record.

Pointer pointing to a long variable. The value is the verification mode of the received attendance record. The specific values are the same as those of GetGeneralLogData.

Pointer pointing to a long variable. The value is the attendance state of the reserved attendance record. The specific values are the same as those of GetGeneralLogData.

Pointer pointing to a BSTR variable. The value is the attendance time of the received attendance record.

Return Value

Return True if it is successful, or return False.

Related Function

GetGeneralLogData

 

Ejemplo

C#

private void GetGeneralLogDataStr(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1)
{
	//Create Standalone SDK class dynamicly.
	zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();

	int idwErrorCode = 0;

	int idwEnrollNumber = 0;
	int idwVerifyMode = 0;
	int idwInOutMode = 0;
	string sTime = "";

	int iGLCount = 0;
	int iIndex = 0;

	axCZKEM1.EnableDevice(iMachineNumber, false);//disable the device
	if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read the records to the memory
	{
		while (axCZKEM1.GetGeneralLogDataStr(iMachineNumber, ref idwEnrollNumber, ref idwVerifyMode, ref idwInOutMode, ref sTime))//get the records from memory
		{
			iGLCount++;
		   MessageBox.Show(" iGLCount:" + iGLCount.ToString()+
			"idwEnrollNumber:" +idwEnrollNumber.ToString()+
			"idwVerifyMode:"+ idwVerifyMode.ToString()+
			"idwInOutMode:"+idwInOutMode.ToString()+
			"sTime:"+ sTime);
			iIndex++;
		}
	}
	else
	{
		axCZKEM1.GetLastError(ref idwErrorCode);

		if (idwErrorCode != 0)
		{
			MessageBox.Show("Reading data from terminal failed,ErrorCode: " + idwErrorCode.ToString(), "Error");
		}
		else
		{
			axCZKEM1.GetLastError(ref idwErrorCode);
			MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
		}
	}
	axCZKEM1.EnableDevice(iMachineNumber, true);//enable the device
}
}

VB

Private Sub GetGeneralLogDataStr(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 idwErrorCode As Integer

	Dim idwEnrollNumber As Integer
	Dim idwVerifyMode As Integer
	Dim idwInOutMode As Integer
	Dim sTime = ""

	Dim lvItem As New ListViewItem("Items", 0)
	Dim iGLCount = 0

	axCZKEM1.EnableDevice(iMachineNumber, False) 'disable the device
	If AxCZKEM1.ReadGeneralLogData(iMachineNumber) Then 'read the records to the memory
		'get the records from memory
		While AxCZKEM1.GetGeneralLogDataStr(iMachineNumber, idwEnrollNumber, idwVerifyMode, idwInOutMode, sTime)
			iGLCount += 1
			MsgBox("iGLCount: " & iGLCount.ToString() &
			"idwEnrollNumber:" & idwEnrollNumber.ToString() &
			"idwVerifyMode:" & idwVerifyMode.ToString() &
			"idwInOutMode: " & idwInOutMode.ToString() &
			"sTime: " & sTime)
		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