我正在使用 zkemkeeper.dll 从生物识别设备下载出勤记录。
if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
{
while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out idwEnrollNumber, out idwVerifyMode
, out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkCode))//get records from the memory
{
//code here
}
}
我的问题是如何通过zkemkeeper下载指定时间(日期范围)的考勤记录。
ReadGeneralLogData 函数从设备加载所有记录,这花费了太多时间,几乎使设备挂起,因为设备包含超过 15000 条记录。
也不知道如何使用 GetDataFile 函数,我的意思是它保存文件的位置。
请帮忙
最佳答案
我遇到了类似的问题,我不得不这样解决。如果您的应用程序使用数据库或基于文件的数据存储,您可以在保存所有数据后清除设备日志。
if (axCZKEM1.ReadGeneralLogData(iMachineNumber))//read all the attendance records to the memory
{
while (axCZKEM1.SSR_GetGeneralLogData(iMachineNumber, out idwEnrollNumber, out idwVerifyMode
, out idwInOutMode, out idwYear, out idwMonth, out idwDay, out idwHour, out idwMinute, out idwSecond, ref idwWorkCode))//get records from the memory
{
//save your data here
}
//after that you clear the machine log
if (axCZKEM1.ClearGLog(iMachineNumber))
{
axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be refreshed
message = "All att Logs have been cleared from teiminal!, Success";
}
else
{
axCZKEM1.GetLastError(ref idwErrorCode);
message = "Operation failed, ErrorCode = " + idwErrorCode.ToString();
}
}
这样您的下一次下载将快得多并且操作也清晰。您将能够在每次需要时从设备下载所有日志数据,当然,一旦数据存储在数据库中,您就可以对其进行过滤。
请相信我,用户不知道日志数据是在设备中还是在数据库中。重要的是数据存储在某个地方并且用户可以看到它。
关于c# - 如何通过zkemkeeper下载指定时间的考勤记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28717830/