EnableUser

Definition

Usage

Set whether a user is enabled.

Parameter

Device number

User ID

Invalid parameter without specific meanings

User enable flag. True: Enabled. False: Disabled.

Return Value

Return True if it is successful, or return False.

Related Function

None

 

Ejemplo

C#

private void EnableUse(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;
	bool iFlag = true;

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

VB

Private Sub EnableUser(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 Boolean = True

	If axCZKEM1.EnableUser(iMachineNumber, iUserID, 0, 0, iFlag) = True Then
		MsgBox("EnableUser,UserID:" + iUserID.ToString() + " iFlag:" + iFlag.ToString(), "Success")

	Else

		axCZKEM1.GetLastError(idwErrorCode)
		MsgBox("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error")
	End If
End Sub