Download face templates. The only difference between this function and GetUserFaceStr is the format of the returned face template.
Device number
UserID (with less than 24 bits)
Face index. The value can be only 50, that is, all face templates of the user are uploaded.
Face template
Face template length
Return True if it is successful, or return False.
SetUserFace, DelUserFace, SetUserFaceStr, GetUserFaceStr
/// <summary> /// Download face templates. The only difference between this function and GetUserFaceStr is the format of the returned face template. /// </summary> /// <param name="EnrollNumber">UserID (with less than 24 bits)</param> /// <param name="IP"> Ip of device </param> /// <param name="Port"> Port of Device </param> /// <param name="MachineNumber"> Device Number </param> private void GetUserFace(string EnrollNumber, string IP = "10.0.0.44", int Port = 4370, int MachineNumber = 1) { //Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); axCZKEM1.Connect_Net(IP, Port); int idwErrorCode = 0; int FaceIndex = 50; byte TmpData = 0; int Length = 0; if (axCZKEM1.GetUserFace(MachineNumber, EnrollNumber, FaceIndex, ref TmpData, ref Length))//get the face templates from the memory { MessageBox.Show("UserID: " + EnrollNumber + ", FaceIndex: " + FaceIndex.ToString() + ", TmpData: " + TmpData + ", Length: " + Length.ToString(), "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } }
''' <summary> ''' Download face templates. The only difference between this function And GetUserFaceStr Is the format of the returned face template. ''' </summary> ''' <param name="EnrollNumber">UserID (with less than 24 bits)</param> ''' <param name="IP"> Ip of device </param> ''' <param name="Port"> Port of Device </param> ''' <param name="MachineNumber"> Device Number </param> Private Sub GetUserFace(EnrollNumber As String, TmpLength As Integer, Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1) Dim idwErrorCode As Integer = 0 'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM axCZKEM1.Connect_Net(IP, Convert.ToInt32(Port)) Dim FaceIndex As Integer = 50 Dim TmpData As Byte = 0 Dim Length As Integer = 0 If (axCZKEM1.GetUserFace(MachineNumber, EnrollNumber, FaceIndex, TmpData, Length)) Then 'get the face templates from the memory MsgBox("UserID: " & EnrollNumber & ", FaceIndex: " & FaceIndex.ToString() & ", TmpData: " & TmpData & ", Length: " & Length.ToString(), MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If End Sub