How to retrieve single User info from ZKTeco device

655 views Asked by At

How can I retrieve single user data from ZKTeco device? I was able to retrieve all the data into a Listbox, but now I want to load the data from a single user to Textboxes using a Textbox with the user ID.

I tried:

 Private Sub txtUserID_TextChanged(sender As Object, e As EventArgs) Handles txtUserID.TextChanged
    
            If bIsConnected = False Then
                MsgBox("Please connect the device first", MsgBoxStyle.Exclamation, "Error")
                Return
            End If
    
            Dim sdwEnrollNumber As String = ""
            Dim sName As String = ""
            Dim sPassword As String = ""
            Dim iPrivilege As Integer
            Dim bEnabled As Boolean = False
            Dim sCardnumber As String = ""
    
            lbRTShow.Items.Clear()
            lbRTShow.BeginUpdate()
            Cursor = Cursors.WaitCursor
            axCZKEM1.EnableDevice(iMachineNumber, False) 
            axCZKEM1.ReadAllUserID(iMachineNumber) 
            While axCZKEM1.SSR_GetUserInfo(iMachineNumber, sdwEnrollNumber, sName, sPassword, iPrivilege, bEnabled) = True 'get user information from memory
                If axCZKEM1.GetStrCardNumber(sCardnumber) = True Then 
                    txtCardnumber.Text = sdwEnrollNumber
                    txtName.Text = sName
                    txtPassword.Text = sPassword
                    txtUserID.Text = sCardnumber
    
                End If
    
            End While
    
            axCZKEM1.EnableDevice(iMachineNumber, True) 
            lbRTShow.EndUpdate()
            Cursor = Cursors.Default
    
    End Sub

But doesn't return anything.

1

There are 1 answers

0
Karti On

Make sure to pass the parameter with "out" keyword for sName, sPAssword, iPriviege and bEnabled.

axCZKEM1.SSR_GetUserInfo(iMachineNumber, sdwEnrollNumber, out sName, out sPassword, out iPrivilege, out bEnabled)

You can try and let me know, if it works.