SetUnlockGroups

Definition

Usage

Set the open door combination.

Parameter

Device number

Open door combination. Ten combinations need to be set and separated by ":". For

example, "12:23:14:15::::::" represent four valid combinations, that is, combination 1

(12 represents groups 1 and 2), combination 2 (23 represent groups 2 and 3),

combination 3 (14 represent groups 1 and 4), and combination 4 (15 represent

groups 1 and 5).

Return Value

Return True if it is successful, or return False.

Related Function

GetUnlockGroups

 

Ejemplo

C#

    /// <summary>
    /// Set the unlock groups combination information.
    /// </summary>
    /// <param name="Groups">Open door combination of the current device. The return values include 10
    /// combinations separated by ":". For example, "12:23:14:15::::::." represent four valid
    /// combinations, that Is, combination 1 (12 represents groups 1 And 2), combination 2
    /// (23 represent groups 2 And 3), combination 3 (14 represent groups 1 And 4), And
    /// combination 4 (15 represent groups 1 And 5).</param>
    /// <param name="IP"> Ip of device </param>
    /// <param name="Port"> Port of Device </param>
    /// <param name="MachineNumber"> Device Number </param>
    private void SetUnlockGroups(string Groups = "", string IP = "10.0.0.44", int Port = 4370, int MachineNumber = 1)
        {
    //Create Standalone SDK class dynamicly.
            zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
            axCZKEM1.Connect_Net(IP, Port);
    int idwErrorCode = 0;
    if (axCZKEM1.SetUnlockGroups(MachineNumber, Groups))
            {
                axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed
                MessageBox.Show("SetUnlockGroups, Groups:" + Groups, "Success");
            }
    else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

''' <summary>
    ''' Set the unlock groups combination information.
    ''' </summary>
    ''' <param name="Groups">Open door combination of the current device. The return values include 10
    ''' combinations separated by ":". For example, "12:23:14:15::::::." represent four valid
    ''' combinations, that Is, combination 1 (12 represents groups 1 And 2), combination 2
    ''' (23 represent groups 2 And 3), combination 3 (14 represent groups 1 And 4), And
    ''' combination 4 (15 represent groups 1 And 5).</param>
    ''' <param name="IP"> Ip of device </param>
    ''' <param name="Port"> Port of Device </param>
    ''' <param name="MachineNumber"> Device Number </param>
    Private Sub SetUnlockGroups(Optional Groups As String = "", Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1)
        'Create Standalone SDK class dynamicly.
        Dim axCZKEM1 As New zkemkeeper.CZKEM
        axCZKEM1.Connect_Net(IP, Port)
        Dim idwErrorCode As Integer = 0
        If axCZKEM1.SetUnlockGroups(MachineNumber, Groups) = True Then
            axCZKEM1.RefreshData(MachineNumber) 'the data in the device should be refreshed
            MsgBox("SetUnlockGroups, Groups:" & Groups, MsgBoxStyle.Information, "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
    End Sub