问题描述
我正在用 C# 开发一个项目,我想使用他们的指纹登录/验证用户.
I am developing a project in C#, for which I want to login/authenticate a user using their fingerprint.
我购买了 ZK4500 指纹扫描仪,并从 http://www.zkteco 获得了它的 SDK.com/product/ZK4500_238.html.SDK 采用 C++ 语言.
I bought a ZK4500 Fingerprint scanner and got its SDK from http://www.zkteco.com/product/ZK4500_238.html. The SDK is in C++.
那么,如何将此 SDK 与我的 C# 项目集成以执行所需的功能?
So How can I integrate this SDK with my C# project to perform the desired functionality?
推荐答案
您需要添加对将出现在 COM 类型库下的 ZKFPEngXControl 的引用.之后,您可以使用 ZKFPEngX 类做任何您需要的事情.
You need to add reference to ZKFPEngXControl that will appear under COM Type Libraries. After that you can use the ZKFPEngX Class to do whatever you require.
using ZKFPEngXControl;
然后
ZKFPEngX fp = new ZKFPEngX();
fp.SensorIndex = 0;
fp.InitEngine(); // Do validation as well as it returns an integer (0 for success, else error code 1-3)
//subscribe to event for getting when user places his/her finger
fp.OnImageReceived += new IZKFPEngXEvents_OnImageReceivedEventHandler(fp_OnImageReceived);
您可以编写自己的方法 fp_OnImageReceived 来处理事件.例如你可以用那个方法写这个;
You can write your own method fp_OnImageReceived to handle the event. for example you can write this in that method;
object imgdata = new object();
bool b = fp.GetFingerImage(ref imgdata);
其中 imgdata 是一个字节数组.您还可以使用 ZKFPEngX 中的其他方法来实现您的目标.记得在表单关闭时关闭引擎.
Where imgdata is an array of bytes.You can also use other methods in ZKFPEngX, to achieve your goals. Remember to close the engine when form closes.
fp.EndEngine();
这篇关于如何在 C# 项目中使用 ZK4500 指纹扫描仪 SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!