3

I am facing trouble in calling events in Zkemkeeper.dll. I have succesfully established the connection however on putting the finger on sensor no event is fired. Infact no realtime event is being triggered.

Any help would be appreciated following is my code;

private void button2_Click(object sender, EventArgs e)
{
    string s = "";
    int Val = 0;
    bool bIsConnected = false;
    try {
        //zkemkeeper.CZKEMClass axczkem1 = new zkemkeeper.CZKEMClass();
       // bIsConnected = axczkem1.Connect_USB(1);
        bIsConnected = axczkem1.Connect_Com(6,1,115200);

        if(bIsConnected==true){
            Cursor = Cursors.Default;
           bool asa= axczkem1.EnableDevice(1, true);
            if (axczkem1.RegEvent(1, 65535))
            {

              axczkem1.OnFinger += new zkemkeeper._IZKEMEvents_OnFingerEventHandler(axczkem1_OnFinger);
             axczkem1.OnKeyPress += new zkemkeeper._IZKEMEvents_OnKeyPressEventHandler(axczkem1_OnKeyPress);
             axczkem1.OnConnected += new _IZKEMEvents_OnConnectedEventHandler(axCZKEM1_OnConnected);
             axczkem1.OnVerify += new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(axCZKEM1_OnVerify);
            }
        MessageBox.Show("Connection established!!!");
        }
    }
    catch(Exception ex) 
    {
        MessageBox.Show(ex.ToString());
    }
}

And following are the event methods:

private void axCZKEM1_OnVerify(int UserID)
    {
        label2.Text = "Verify";
    }

    private void axCZKEM1_OnConnected()
    {
        label1.Text = "Connected";
    }

    private void axczkem1_OnKeyPress(int Key)
    {
        MessageBox.Show(Key.ToString());
    }

    private void axczkem1_OnFinger()
    {
        MessageBox.Show("Connection");
    }
Umar Raj
  • 31
  • 1
  • 3
  • Not all the devices of zk support the real-time events. So, make sure our model does support. Can you also share the model here? – Ravanan Sep 21 '18 at 02:23

1 Answers1

0
  1. if this is a windows form application . If program have long running process event doesn't work . For example loop (while,for) . And also Thread.sleep() . If you want to trigger work your program do nothing .
  2. If this is not a windows form see this link enter link description here
Community
  • 1
  • 1