Set user information. If the user is unavailable, the device automatically creates the user.


Device number

User ID

User name to be set

User password to be set. If the value is null, the user password on the device is cleared.

User privilege. 0: common user, 1: enroller, 2: administrator, 3: super administrator

User enable flag. 1: Enabled. 0: Disabled

Return Value

Return True if it is successful, or return False.

Related Function





private static void SetUserInfo(string sIp = "", int iPort = 4370, int iMachineNumber = 1)
	//Create Standalone SDK class dynamicly.
	zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
	axCZKEM1.Connect_Net(sIp, iPort);

	int idwEnrollNumber = 0;
	string sName = "";
	int iPrivilege = 0;
	string sPassword = "";
	bool bEnabled = false;

	axCZKEM1.EnableDevice(iMachineNumber, false);
	idwEnrollNumber = 1;
	sName = "Prueba";
	iPrivilege = 1;
	sPassword = "123";

	if (axCZKEM1.SetUserInfo(iMachineNumber, idwEnrollNumber, sName, sPassword, iPrivilege, bEnabled))//upload user information to the memory
		MessageBox.Show(" Success");
		MessageBox.Show(" UnSuccess");

	axCZKEM1.EnableDevice(iMachineNumber, true);


Private Shared Sub SetUserInfo(Optional ByVal sIp As String = "", Optional ByVal iPort As Integer = 4370, Optional ByVal iMachineNumber As Integer = 1)
	'Create Standalone SDK class dynamicly.
	Dim axCZKEM1 As New zkemkeeper.CZKEM
	axCZKEM1.Connect_Net(sIp, iPort)

	Dim sName As String = ""
	Dim iPrivilege As Integer = 0
	Dim sPassword As String = ""
	Dim bEnabled As Boolean = False
	Dim idwEnrollNumber As Integer

	axCZKEM1.EnableDevice(iMachineNumber, False)
	idwEnrollNumber = 1
	sName = "Prueba"
	iPrivilege = 1
	sPassword = "123"

	If axCZKEM1.SetUserInfo(iMachineNumber, idwEnrollNumber, sName, sPassword, iPrivilege, bEnabled) = True Then ' upload Then user information To the memory
		MsgBox(" Success")
		MsgBox(" UnSuccess")
	End If

	axCZKEM1.EnableDevice(iMachineNumber, True)
End Sub