public bool StartEnroll_face(string sIp = "192.168.1.201", int iPort = 4370, int iMachineNumber = 1, string userid = "", int fingureindex = 0)
{
//Create Standalone SDK class dynamicly.
zkemkeeper.CZKEM axCZKEM1 = new zkemkeeper.CZKEM();
axCZKEM1.Connect_Net(sIp, iPort);
int idwErrorCode = 0;
string sUserID = userid;
int iFingerIndex = fingureindex;
// if finger index is 111 then it will save image on device
int iFlag = 0;
axCZKEM1.CancelOperation();
axCZKEM1.DelUserFace(iMachineNumber, sUserID, iFingerIndex);
axCZKEM1.RefreshData(1);//the data in the device should be refreshed
if (axCZKEM1.StartEnrollEx(sUserID, iFingerIndex, iFlag))
{
MessageBox.Show("Start to Enroll a new User,UserID=" + sUserID + " Face ID=" + iFingerIndex.ToString() + " Flag=" + iFlag.ToString(), "Start");
iCanSaveTmp = 1;
axCZKEM1.StartIdentify();//After enrolling templates,you should let the device into the 1:N verification condition
axCZKEM1.RefreshData(1);//the data in the device should be refreshed
startenroll_retult = true;
}
else
{
axCZKEM1.GetLastError(ref idwErrorCode);
MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
startenroll_retult = false;
}
axCZKEM1.Disconnect();
return startenroll_retult;
}
Now Call the Function
if (StartEnroll_face("192.168.1.201", 4370, 1, txt_id_memb.Text,111))
{
// finger index 111 means register face of user
MessageBox.Show("Face Registered!");
}