SSR_GetShortkey

Definition

Usage

Obtain the setting of a specific function key.

Parameter

ID of the specified key to be obtained. The mappings are as follows: F1 ? 1, F2 ? 2, F3 ? 3 ……

Function of the specified key.

0: not defined, 1: state key, 2: work code, 3: view short messages

If the specified key is a state key (that is, the value of ShortKeyFun is 1), return the

state of this state key, Otherwise, return 0.

If the specified key is a state key (that is, the value of ShortKeyFun is 1), return the

name of this state key. Otherwise, return a null string.

If the specified key is a state key (that is, the value of ShortKeyFun is 1), return

whether this state key is automatically changed. Otherwise, return 0.

If the specified key is a state key (that is, the value of ShortKeyFun is 1), return

automatic change time (in string form) of this state key. Otherwise, return a null

string.

Return Value

Return True if it is successful, or return False.

Related Function

SSR_SetShortkey

 

Ejemplo

C#

        /// <summary>
        /// Get the configeration of a certain function key.
        /// Please refer to development manual to look over detailed parameters.
        /// </summary>
        /// <param name="ShortKeyID"></param>
        /// <param name="IP"> Ip of device </param>
        /// <param name="Port"> Port of Device </param>
        /// <param name="MachineNumber"> Device Number </param>
        private void SSR_GetShortkey(int ShortKeyID, 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;
        int Fun = 0;
        int StateCode = 0;
        string StateName = "";
        int AutoChange = 0;
        string Time = "";
        if (axCZKEM1.SSR_GetShortkey(ShortKeyID, ref Fun, ref StateCode, ref StateName, ref AutoChange, ref Time))
            {
                MessageBox.Show("Shortkey=  ShortKeyFun:" + Fun.ToString() + ", StateCode:" + StateCode.ToString() + ", StateName:" + StateName + ", AutoChange: " + AutoChange.ToString() + ", Time: " + Time, "Success");
            }
        else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

        ''' <summary>
''' Get the configeration of a certain function key.
''' Please refer to development manual to look over detailed parameters.
''' </summary>
''' <param name="ShortKeyID"></param>
''' <param name="IP"></param>
''' <param name="Port"></param>
''' <param name="MachineNumber"></param>
Private Sub SSR_GetShortkey_Click(ShortKeyID 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 Fun As Integer
Dim StateCode As Integer
Dim StateName As String = ""
Dim AutoChange As Integer
Dim Time As String = ""
If axCZKEM1.SSR_GetShortkey(ShortKeyID, Fun, StateCode, StateName, AutoChange, Time) = True Then
            MessageBox.Show("Shortkey=  ShortKeyFun:" & Fun.ToString() & ", StateCode:" & StateCode.ToString() & ", StateName:" & StateName & ", AutoChange: " & AutoChange.ToString() & ", Time: " & Time, "Success")
Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
End If
End Sub