Java uses Jacob to call the master Attendance Machine SDK Method 1, jacob-1.19 version
2, jdk1.8 64 bits (tested JACOB.1.19 support 64 for JDK);
3, put Jacob.jar into the project Web-info/lib under import:
4, put Jacob-1.19-x64.dll into 64-bit Jre/bin directory, my is: D:\java\jdk1.8.0_101\jre\bin;
5, the central control attendance Machine SDK dll files are all put into the C:\Windows\System32 directory
6. Run cmd to register zkemkeeper.dll--->regsvr32 c:\windows\system32\zkemkeeper.dll (you can also use autoenrollment. bat)
7, after the success of the following tips: There will be a bullet box
8, has been configured to test the code:
Zkemkeeper. Zkem.1 for Zkemkeeper.dll after successful registration in the registry can be viewed: HKEY_CLASSES_ROOT the bottom
Package Com.zsplat.zke;import com.jacob.activex.activexcomponent;/** * @ClassName: ${type_name} * @Description: ${todo } (Time Machine connection test) * @author: Zhoupan * @date ${date} ${time} * @Copyright: 2018 Www.zsplat.com Inc. All rights reserved. * ${tags} */public class Zkemsdk { private static activexcomponent Zkem = new Activexcomponent ("Zkemkeeper. Zkem.1 "); /** * Link Attendance Machine * * @param address of the attendance machine * @param port Port number * @return */Public Boolean Connect (String address, int port) { Boolean result = Zkem.invoke ("connect_net", address, Port). Getboolean (); return result; } /** * Disconnect the attendance machine link */public void DisConnect () { Zkem.invoke ("DisConnect"); } public static void Main (string[] args) { zkemsdk SDK = new Zkemsdk (); Boolean Connflag = Sdk.connect ("192.168.1.201", 4370); SYSTEM.OUT.PRINTLN ("conn:" +connflag);} }
9, the output is true, the attendance machine link success
Zkteco iface702 Time Attendance Machine Java Development Step One---connection attendance machine