ModifyPrivilege

Definition

Usage

Modify user privileges.

Parameter

Device number

User ID

Invalid parameter without specific meanings

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

Return Value

Return True if it is successful, or return False.

Related Function

SetUserInfo, GetUserInfo

 

Ejemplo

C#

	private void ModifyPrivilege(string sIp = "10.0.0.44", int iPort = 4370, int iMachineNumber = 1)
	{
		//Create Standalone SDK class dynamicly.
		zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
		axCZKEM1.Connect_Net(sIp, iPort);
		int idwErrorCode = 0;

		int iUserID = 1;
		int iFlag = 1;

		if (axCZKEM1.ModifyPrivilege(iMachineNumber, iUserID, 0, 0, iFlag))
		{

			MessageBox.Show("ModifyPrivilege,UserID:" + iUserID.ToString() + " iFlag:" + iFlag.ToString(), "Success");
		}
		else
		{
			axCZKEM1.GetLastError(ref idwErrorCode);
			MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
		}
	}

VB

    Private Shared Sub ModifyPrivilege(Optional ByVal sIp As String = "10.0.0.44", 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 idwErrorCode As Integer

        Dim iUserID As Integer = 1
        Dim iFlag As Integer = 1

        If axCZKEM1.ModifyPrivilege(iMachineNumber, iUserID, 0, 0, iFlag) = True Then

            MsgBox("ModifyPrivilege,UserID:" + iUserID.ToString() + " iFlag:" + iFlag.ToString(), "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error")
        End If
    End Sub