在Windows服务中使用SDK中的Zkemkeeper dll进行生物识别扫描程序 [英] Using Zkemkeeper dll from SDK for Biometric scanner in Windows Service

查看:84
本文介绍了在Windows服务中使用SDK中的Zkemkeeper dll进行生物识别扫描程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



我从印度经销商处购买了生物识别扫描仪SDK。



我正在使用zkemkeeper.dll,同时将生物识别扫描器与C#代码连接。



我使用处理程序OnAttTransactionExEventHandler来获取手指按下时的更新终奌站。这与在Windows窗体中编写的代码交互时工作正常。



问题:



当我使用时这个相同的事件处理程序,使用C#代码编写的Windows服务。

处理程序不起作用,即当在生物识别终端上按下手指时,处理程序方法不会被触发。

我也使用regEvent(deviceid,1)用于所有OnAttTransaction / OnAttTransactionEx,并且还使用regEvent(deviceid,65532)来注册所有事件,但仍然存在同样的问题。

我写了整个代码在OnStart()中,生物识别机也可以连接,但是处理程序没有启动。



需要工作:



我创建了一个Windows服务,它将在Windows 7 64位计算机上启动。

我使用了生物识别扫描程序,SDK 6.0.3.3和zkemkeeper.dll版本2.0.0.1。当用户将手指放在扫描仪上时,OnAttTransactionExEventHandler必须触发才能执行用此方法编写的操作。



请帮助我解决此问题。



提前致谢,

Nitesh

Hi Team,

I have purchased your SDK for biometric scanner from a dealer from India.

I am using zkemkeeper.dll, while interfacing Biometric scanner with C# code.

I am using the handler OnAttTransactionExEventHandler for getting the update when a finger is pressed on the terminal. This works fine when interacting with code written in Windows Forms.

Issue:

When I am using this same event handler, with Windows Service written with C# code.
The handler does not work, i.e. when finger is pressed on the Biometric terminal the handler method does not get fired.
I am also using regEvent(deviceid,1) for all OnAttTransaction/OnAttTransactionEx and also used regEvent(deviceid,65532) for registering all events, but still same problem.
I have written the whole code in OnStart(), biometric machine also gets connected, but handler is not firing up.

Needed Working:

I have created a windows service, which will be started on a windows 7 64-bit machine.
I have used Biometric scanner with SDK 6.0.3.3 and zkemkeeper.dll version 2.0.0.1. When user places the finger on scanner, OnAttTransactionExEventHandler must fire to perform the action written in this method.

Please help me out as am stuck for this issue.

Thanks in advance,
Nitesh

推荐答案

试试这个:

Try this:
myCZKEMClass = new CZKEMClass();

Thread createComAndMessagePumpThread = new Thread(() =>
{
    myCZKEMClass.Connect_Net("192.168.1.20", 4370);


    if (myCZKEMClass.RegEvent(1, 65535))
    {
        myCZKEMClass.OnAttTransactionEx += new _IZKEMEvents_OnAttTransactionExEventHandler(myCZKEMClass_OnAttTransactionEx);
    }

    Application.Run();
});
createComAndMessagePumpThread.SetApartmentState(ApartmentState.STA);

createComAndMessagePumpThread.Start();

eventLog1.WriteEntry("Service Started");



将代码放在服务的Start方法中。你需要添加一个对System.Windows.Form库的引用。

但是这个SDK似乎有另一个问题,如果让服务空闲,事件将在几分钟后停止工作(同样的事情发生在WinForms上)太)。我不确定是否只有我有这个问题,但代码示例给了我相同的结果。


Put the code inside Start method of the service. You need to add a reference to System.Windows.Form library.
But this SDK seems have another problem, the event will stop working after couple mins if you let the service idle (same thing happened to WinForms too). I'm not sure if it's only me who had this problem, but the code samples gave me same result.


这篇关于在Windows服务中使用SDK中的Zkemkeeper dll进行生物识别扫描程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆