Download face templates. Difference from GetUserFace, this function is used to return face templates in string format.
Device number
UserID (with less than 24 bits)
Face index. The value can be only 50, that is, deleting all face templates of the user
Face template
Face template length
Return True if it is successful, or return False.
GetUserFace, SetUserFace, SetUserFaceStr
/// <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 GetUserFaceStr(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; string TmpData = ""; int Length = 0; if (axCZKEM1.GetUserFaceStr(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 GetUserFaceStr(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 String = "" Dim Length As Integer = 0 If (axCZKEM1.GetUserFaceStr(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