SSR_GetWorkCode

Definition

Usage

Obtain the ID of the specified work code. For details, see SetWorkCode.

Parameter

DID of the work code

ID of the work code described by WorkCodeID

Return Value

Return True if it is successful, or return False.

Related Function

SetWorkCode

 

Ejemplo

C#

        /// <summary>
        /// Get the workcode according to its id.
        /// </summary>
        /// <param name="AWorkCodeID">ID of a work code</param>
        /// <param name="IP"> Ip of device </param>
        /// <param name="Port"> Port of Device </param>
        /// <param name="MachineNumber"> Device Number </param>
        private void SSR_GetWorkCode(int AWorkCodeID, 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;
        string sName = "";
        if (axCZKEM1.SSR_GetWorkCode(AWorkCodeID, out sName))
            {
                MessageBox.Show("Work Code: " + sName, "Success");
            }
        else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

        ''' <summary>
        ''' Get the workcode by its id.
        ''' </summary>
        ''' <param name="AWorkCodeID">ID of a work code</param>
        ''' <param name="IP"> Ip of device </param>
        ''' <param name="Port"> Port of Device </param>
        ''' <param name="MachineNumber"> Device Number </param>
        Private Sub GetWorkCode(AWorkCodeID As Integer, Optional IP As String = "10.0.0.44", Optional Port As Integer = 4370, Optional MachineNumber As Integer = 1)
        Dim idwErrorCode As Integer = 0
        'Create Standalone SDK class dynamicly.
        Dim axCZKEM1 As New zkemkeeper.CZKEM
        axCZKEM1.Connect_Net(IP, Convert.ToInt32(Port))
        Dim sName As String = ""
        If axCZKEM1.SSR_GetWorkCode(AWorkCodeID, sName) = True Then
            MsgBox("Work Code=" + sName, MsgBoxStyle.Information, "Success")
        Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
        End If
        End Sub