OnNewUser

This event is triggered when a new user is successfully enrolled.

Return Value

UserID of the newly enrolled user.

 

Ejemplo

C#

//Create Standalone SDK class dynamicly.
        zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
        //the boolean value identifies whether the device is connected
        int iMachineNumber = 1;
        private void Connect_OnNewUser(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1)
        {
            //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)

                this.axCZKEM1.OnNewUser += new zkemkeeper._IZKEMEvents_OnNewUserEventHandler(axCZKEM1_OnNewUser);
            }
            else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Unable to connect the device,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

        private void axCZKEM1_OnNewUser(int iEnrollNumber)
        {
            MessageBox.Show("RTEvent OnNewUser Has been Triggered..."+
                            "...NewUserID=" + iEnrollNumber.ToString());
        }

        private void Disconnect_OnNewUser()
        {
            axCZKEM1.Disconnect();
            this.axCZKEM1.OnNewUser -= new zkemkeeper._IZKEMEvents_OnNewUserEventHandler(axCZKEM1_OnNewUser);
        }

VB

    'Create Standalone SDK class dynamicly.
    Dim axCZKEM1 As New zkemkeeper.CZKEM

    Private Sub Connect_OnNewUser(sIp As String, iPort As Integer, iMachineNumber As Integer)

        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.OnNewUser, AddressOf AxCZKEM1_OnNewUser
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Unable to connect the device,ErrorCode=" & idwErrorCode, MsgBoxStyle.Exclamation, "Error")
        End If
    End Sub
    Private Sub AxCZKEM1_OnNewUser(ByVal iEnrollNumber As Integer)
        MsgBox("RTEvent OnNewUser Has been Triggered..." &
        "...NewUserID=" & iEnrollNumber.ToString())
    End Sub


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