Получить журнал отпечатков пальцев в реальном времени от ZKTECO Speedface V5L до C# WinformC#

Место общения программистов C#
Anonymous
Получить журнал отпечатков пальцев в реальном времени от ZKTECO Speedface V5L до C# Winform

Сообщение Anonymous »

Я попытался интегрировать свое приложение Winform с посещаемостью в реальном времени.
Я использовал класс Zkemkeeper. подключенные устройства.
может читать другие данные. но не может получить журнал в реальном времени. < /p>

Код: Выделить всё

    private void EnableRealTimeTracking()
{

if (isConnected)
{

zkem.OnAttTransactionEx += RealTimeLogHandler;
MessageBox.Show("Real-time tracking enabled.");
}
else
{
MessageBox.Show("Please connect to the device first.");
}
}

private void RealTimeLogHandler(
string EnrollNumber,
int IsInValid,
int AttState,
int VerifyMethod,
int Year,
int Month,
int Day,
int Hour,
int Minute,
int Second,
int WorkCode)
{
// Construct the date-time string for the transaction
string dateTime = $"{Year}-{Month:D2}-{Day:D2} {Hour:D2}:{Minute:D2}:{Second:D2}";

// Determine the verification method (e.g., Fingerprint or other)
string verifyMethodStr = VerifyMethod == 1 ? "Fingerprint" : "Other";

// Determine the attendance state (In or Out)
string attStateStr = AttState == 1 ? "In" : "Out";

// If the transaction is valid, process it
if (IsInValid == 1)
{
// Update the DataTable with the attendance information
// We are using Invoke to ensure thread-safety when updating the UI from the event handler
Invoke(new Action(() =>
{
// Add a new row to the DataTable for the attendance log
attendanceTable.Rows.Add(EnrollNumber, verifyMethodStr, dateTime, WorkCode);
}));
}
else
{
// Optionally, handle invalid transactions, if needed
// For example, you can log it or alert the user
Console.WriteLine("Invalid attendance transaction for user: " + EnrollNumber);
}
}
Мне нужны эти данные журнала в реальном времени, поэтому, пожалуйста, дайте мне знать, как их вызвать или если у вас есть какие-либо предложения.

Подробнее здесь: https://stackoverflow.com/questions/792 ... rp-winform

Вернуться в «C#»