OnVerify

OnVerify (LONG UserID) This event is triggered when a user is verified.

Return Value

When verification succeeds, UserID indicates the ID

 

Ejemplo

C#

    private  void Connect(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1 )
    {
        //Create Standalone SDK class dynamicly.
        zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
        //the boolean value identifies whether the device is connected
        bool bIsConnected = false;
        //the serial number of the device.After connecting the device ,this value will be changed.
        int idwErrorCode = 0;
 

        bIsConnected = axCZKEM1.Connect_Net(sIp, iPort);
        if (bIsConnected == true)
        {
            iMachineNumber = 1;//In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1.
            axCZKEM1.RegEvent(iMachineNumber, 65535);//Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all)
                
                axCZKEM1.OnVerify += new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(axCZKEM1_OnVerify);
        }
        else
        {
            axCZKEM1.GetLastError(ref idwErrorCode);
            MessageBox.Show("Unable to connect the device,ErrorCode=" + idwErrorCode.ToString(), "Error");
        }
    }
    private void axCZKEM1_OnVerify(int iUserID)
    {
        MessageBox.Show("RTEvent OnVerify Has been Triggered,Verifying...");
        if (iUserID != -1)
        {
            MessageBox.Show("Verified OK,the UserID is " + iUserID.ToString());
        }
        else
        {
            MessageBox.Show("Verified Failed... ");
        }
    }

    private void Disconnect()
    {
        //Create Standalone SDK class dynamicly.
        zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
        axCZKEM1.Disconnect();

        axCZKEM1.OnVerify -= new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(axCZKEM1_OnVerify);
    }

VB

Private Sub Connect(sIp As String, iPort As Integer, iMachineNumber As Integer)
    'Create Standalone SDK class dynamicly.
    Dim axCZKEM1 As New zkemkeeper.CZKEM
    axCZKEM1.Connect_Net(sIp, iPort)
    'the boolean value identifies whether the device Is connected
    Dim bIsConnected As Boolean = False
    'the serial number of the device.After connecting the device ,this value will be changed.
    Dim idwErrorCode As Integer = 0

    bIsConnected = axCZKEM1.Connect_Net(sIp, iPort)
    If bIsConnected = True Then
        iMachineNumber = 1 'In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1.
        axCZKEM1.RegEvent(iMachineNumber, 65535) 'Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all)
        AddHandler axCZKEM1.OnVerify, AddressOf AxCZKEM1_OnVerify
    Else
        axCZKEM1.GetLastError(idwErrorCode)
        MsgBox("Unable to connect the device,ErrorCode=" & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
    End If
End Sub

Private Sub AxCZKEM1_OnVerify(ByVal iUserID As Integer)
    MsgBox("RTEvent OnVerify Has been Triggered,Verifying...")
    If iUserID <> -1 Then
        MsgBox("Verified OK,the UserID is " & iUserID.ToString())
    Else
        MsgBox("Verified Failed... ")
    End If
End Sub

Private Sub Disconnect()
    'Create Standalone SDK class dynamicly.
    Dim axCZKEM1 As New zkemkeeper.CZKEM
    axCZKEM1.Disconnect()
    RemoveHandler axCZKEM1.OnVerify, AddressOf AxCZKEM1_OnVerify
End Sub