SetUserFace

Definition

Usage

Upload face templates of a user. The only difference between this function is SetUserFaceStr is the face template format.

Parameter

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 Value

Return True if it is successful, or return False.

Related Function

GetUserFace, DelUserFace, SetUserFaceStr, GetUserFaceStr

 

Ejemplo

C#

        /// <summary>
/// Upload face templates of a user. The only difference between this function is SetUserFaceStr is the face template format. 
/// </summary>
/// <param name="EnrollNumber">UserID (with less than 24 bits)</param>
/// <param name="TmpLength">Face template </param>
/// <param name="IP"> Ip of device </param>
/// <param name="Port"> Port of Device </param>
/// <param name="MachineNumber"> Device Number </param>
private void SetUserFace(string EnrollNumber, int TmpLength, 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;
        if (axCZKEM1.SetUserFace(MachineNumber, EnrollNumber, FaceIndex, ref tmpData, TmpLength))
	{
		MessageBox.Show("SetUserFaceStr!", "Success");
	}
        else
	{
		axCZKEM1.GetLastError(ref idwErrorCode);
		MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
	}
}

VB

        ''' <summary>
        ''' Upload face templates of a user. The only difference between this function Is SetUserFaceStr Is the face template format. 
        ''' </summary>
        ''' <param name="EnrollNumber">UserID (with less than 24 bits)</param>
        ''' <param name="TmpLength">Face template </param>
        ''' <param name="IP"> Ip of device </param>
        ''' <param name="Port"> Port of Device </param>
        ''' <param name="MachineNumber"> Device Number </param>
        Private Sub SetUserFace(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
        If (axCZKEM1.SetUserFace(MachineNumber, EnrollNumber, FaceIndex, tmpData, TmpLength)) Then
            MsgBox("SetUserFaceStr!", MsgBoxStyle.Information, "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
        End Sub