Interface With ZKTeco
Interface With ZKTeco
Introduction
There are requirements where you have to integrate a biometric device into your own application or some part of it like fetching the
attendance records, user information , backing up the fingerprint templates into your system database or export it somewhere remotely etc.
For that very purpose, this article is written as a getting started guide with a few pieces of source code such that it helps C# developers to
save some valuable time with all the troublesome work.
Note: Though, the devices will be of various models, with a different set of sdk, the implementation procedure will be somewhat the same.
The following article contains some useful old pieces of code, if you ever get your hands on a biometric device (fingerprint reader for Time &
Attendance) and want to extract gold(data) out of it.
The article and the source code provided will help you with the following things
1 of 5 11/4/2018, 9:05 PM
C# ZKTeco Biometric Device Getting Started - CodeProject https://www.codeproject.com/Articles/1104538/Csharp-ZKTeco-Biometr...
How to register to device specific events [ Not Implemented/ You will have to implement it yourself per you need ]
Background
Biometric Devices are being used extensively in many corporations through out the world these days. Companies like ZKTeco manufacture
biometric access control and Time and Attendance in various shapes and sizes with different set of featues per model. They provide a better
way of user authentication and security in organizations who implement it. It is a growing demand in todays world. Hence, Developers are
likely to come across its implementation at some point.
In order to implement any biometric device, you will have to register the related components in the system, which can be easily done by using
the Regsvr32 utility. If you dont know how it works, please go through some blog posts in the related topic. We already have a batch file
ready for that very purpose, Hence, we are cool here.
You can download the SDK from here. I have already attached an SDK sample along with this article. You can go through the source code
inside the Register_SDK.bat to see the registration mechanism.
On Successful Registration :
To implement the biometric device , you will have to use the zkemkeeper.dll
1. Add Reference to the zkemkeeper.dll in a project. The dll gives access to the following things.
2. Create a class file and implement the IZKEM interface.
3. Use the CZKEM class file to perform device related operations.
Lets say your Biometric device is connected in the local area network. To make a successfull communication with the device, you need to know
the IP address and the Port No.
2 of 5 11/4/2018, 9:05 PM
C# ZKTeco Biometric Device Getting Started - CodeProject https://www.codeproject.com/Articles/1104538/Csharp-ZKTeco-Biometr...
Registering Events
To fire any event when something occurs in the device, we need to register the event
The EventMask requires an integer value whose value varies based on the type of event. The complete list of EventMast values are given
below
3 of 5 11/4/2018, 9:05 PM
C# ZKTeco Biometric Device Getting Started - CodeProject https://www.codeproject.com/Articles/1104538/Csharp-ZKTeco-Biometr...
lstFPTemplates.Add(fpInfo);
}
}
}
return lstFPTemplates;
}
Result:
Conclusion
Well, that gives you the starting point for your project. With a biometric device in hand, you can now experiment with the source code
yourself and play along.
There are numberous procedures and events to be implemented which you can use per you need. Also, you might want to take help from the
SDK that i have attached along with this article. There are other SDK/manuals which you can find online for more detailed implementation.
Peace !!
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
4 of 5 11/4/2018, 9:05 PM
C# ZKTeco Biometric Device Getting Started - CodeProject https://www.codeproject.com/Articles/1104538/Csharp-ZKTeco-Biometr...
Ozesh Thapa
Software Developer Braindigit IT Solution
Nepal
I am interested in Research & Development based tasks, exploring, experimenting and trying out
new things.
Technologies i have been using up until now are C#, ASP.NET, Win Services, Web Services, Restful
Web API, Windows Application, Windows Phone Application, Store Apps, couple of JavaScript
frameworks, Xamarin Forms, NodeJS, React, ReactNative, AngularJS, SQL Server, MongoDB, Postgres
etc.
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile Article Copyright 2016 by Ozesh Thapa
Web04-2016 | 2.8.180920.1 | Last Updated 17 Jun 2016 Everything else Copyright © CodeProject, 1999-2018
5 of 5 11/4/2018, 9:05 PM