I am trying to assign image to ZKTeco device with the model SFace900. Purpose is to recognize user on face detection. I've a SDK that works fine to download attendance from device using a C#
app, in the same time I can see two default methods is given to assign image or user face as follows:
axCZKEM1.SetUserFace()
axCZKEM1.SetUserFaceStr()
I am not sure but I think it requires base64 string to transfer image to the device. So I tried something like this:
private void SetUserFaceStr(string val)
{
zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
axCZKEM1.Connect_Net(IP, Port);
int idwErrorCode = 0;
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(val);
if (axCZKEM1.SetUserFaceStr(axCZKEM1.MachineNumber, userId, 50, val, byteString.Length))
{
MessageBox.Show("SetUserFaceStr!", "Success");
}
else
{
axCZKEM1.GetLastError(ref idwErrorCode);
MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
}
}
The val variable is actually a base64 string that I am trying to pass. The reason I tried the above, is for this link - Assign Image or Set face. Though I failed, it throws error code 2. Is there anyone who faced the same situation or came up with a solution? This is one of my R & D project, so expecting some suggestions if this can be done.