SetUserFaceStr

Definition

VARIANT_BOOL SetUserFaceStr([in] LONG dwMachineNumber, [in] BSTR dwEnrollNumber, [in] LONG dwFaceIndex, [in]BSTR TmpData, [in] LONG TmpLength)

Usage

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

Parameter

dwMachineNumber Device number
dwEnrollNumber User ID (with less than 24 bits)
dwFaceIndex Face index. The value can be only 50, that is, uploading all face templates of the user.
TmpData Face template
TmpLength Face template length

ReturnValue

Return True if it is successful, or return False.

RelatedFunction

SetUserFace, GetUserFaceStr, GetUserFace

 

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 SetUserFaceStr(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;
        string tmpData = "";
        if (axCZKEM1.SetUserFaceStr(MachineNumber, EnrollNumber, FaceIndex, 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 SetUserFaceStr(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 = ""
    If (axCZKEM1.SetUserFaceStr(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