Set a specific function key, equal to the function of defining function keys of the TFT device.
ID of a shortcut key. The mappings are as follows: F1 — 1, F2 — 2, F3 — 3…
Function of a shortcut key.
0: not defined, 1: state key, 2: work code, 3: view short messages
The value of this parameter affects the settings of the four parameters below. See
descriptions of the four parameters below.
State of a state key.
If the set key is not a state key, the value of this parameter is ignored. That is, if the
value of ShortKeyFun is not 1, the value of this parameter is ignored.
If the set key is a state key (that is, the value of ShortKeyFun is 1), this parameter
specifies the state of the set state key. The valid value ranges from 0 to 255. The
states of state keys must be unique. If the states of state keys are repeated, the
function cannot be called. For example, the F2 key is a state key and its state
value is 2. If you use this function to set F3 as a state key and specify 2 as the
state value of F3, you cannot call this function.
Name of a state key.
If the set key is not a state key, the value of this parameter is ignored. That is, if the
value of ShortKeyFun is not 1, the value of this parameter is ignored.
If the set key is a state key (that is, the value of ShortKeyFun is 1), this parameter
specifies the name of the set state key. The value consists of up to 18 characters.
If the set key is not a state key, the value of this parameter is ignored. That is, if the
value of ShortKeyFun is not 1, the value of this parameter is ignored.
If the set key is a state key (that is, the value of ShortKeyFun is 1), this parameter
specifies whether the automatic change function of the set state key is enabled. 0:
disabled, 1: enabled.
If the set key is not a state key, the value of this parameter is ignored. That is, if the
value of ShortKeyFun is not 1, the value of this parameter is ignored.
If the set key is a state key, this parameter specifies the automatic change time of
the set state key. The requirements are as follows:
1. “08:30;09:00;08:00;12:00;11:12;00:00;00:00;”
2. Hour and minute are separated by ":" without any space. Days are separated by
";" without any space.
3. The automatic change time of each day (with one week as a cycle) must be
specified, that is, the device changes from attendance state to the state described
by StateName (the value is defined by StateCode) when the specified time is
reached. If no automatic change occurs in a specific day, set hour and minute to 0.
Return True if it is successful, or return False.
SSR_GetShortkey
/// <summary> /// Set a certain function key's configeration. /// Please refer to development manual to look over detailed parameters. /// </summary> /// <param name="ShortKeyID">ID of a shortcut key. The mappings are as follows: F1 — 1, F2 — 2, F3 — 3…</param> /// <param name="Fun">Function of a shortcut key. 0: not defined, 1: state key, 2: work code, 3: view short messages The value of this parameter affects the settings of the four parameters below. See descriptions of the four parameters below.</param> /// <param name="StateCode">State of a state key</param> /// <param name="StateName">Name of a state key.</param> /// <param name="AutoChange">If the set key is not a state key, the value of this parameter is ignored. That is, if the value of ShortKeyFun is not 1, the value of this parameter is ignored. /// If the set key is a state key (that is, the value of ShortKeyFun is 1), this parameter specifies whether the automatic change function of the set state key is enabled. 0: disabled, 1: enabled.</param> /// <param name="Time"> If the set key is not a state key, the value of this parameter is ignored.That is, if the /// value of ShortKeyFun is not 1, the value of this parameter is ignored.</param> /// <param name="IP"> Ip of device </param> /// <param name="Port"> Port of Device </param> /// <param name="MachineNumber"> Device Number </param> private void SSR_SetShortkey(int ShortKeyID, int Fun = 0, int StateCode = 0, string StateName = "", int AutoChange = 0, string Time = "", 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 (Fun == 1)//if the function key is status key. { if (axCZKEM1.SSR_SetShortkey(ShortKeyID, Fun, StateCode, StateName, AutoChange, Time)) { axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed MessageBox.Show("SetShortkey! ShortKeyID=" + ShortKeyID.ToString(), "Success"); } else { MessageBox.Show("Operation failed!", "Error"); } } else { if (axCZKEM1.SSR_SetShortkey(ShortKeyID, Fun, StateCode, StateName, AutoChange, Time)) { axCZKEM1.RefreshData(MachineNumber);//the data in the device should be refreshed MessageBox.Show("SetShortkey! ShortKeyID=" + ShortKeyID.ToString(), "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); } } }
''' <summary> ''' Set a certain function key's configeration. ''' Please refer to development manual to look over detailed parameters. ''' </summary> ''' <param name="ShortKeyID">ID of a shortcut key. The mappings are as follows: F1 — 1, F2 — 2, F3 — 3…</param> ''' <param name="Fun">Function of a shortcut key. 0: Not defined, 1: state key, 2: work code, 3: view short messages The value of this parameter affects the settings of the four parameters below. See descriptions of the four parameters below.</param> ''' <param name="StateCode">State of a state key</param> ''' <param name="StateName">Name of a state key.</param> ''' <param name="AutoChange">If the set key Is Not a state key, the value of this parameter Is ignored. That Is, if the value of ShortKeyFun Is Not 1, the value of this parameter Is ignored. ''' If the set key Is a state key (that Is, the value of ShortKeyFun Is 1), this parameter specifies whether the automatic change function of the set state key Is enabled. 0: disabled, 1: enabled.</param> ''' <param name="Time"> If the set key Is Not a state key, the value of this parameter Is ignored.That Is, if the ''' value of ShortKeyFun Is Not 1, the value of this parameter Is ignored.</param> ''' <param name="IP"> Ip of device </param> ''' <param name="Port"> Port of Device </param> ''' <param name="MachineNumber"> Device Number </param> Private Sub SSR_SetShortkey(ShortKeyID As Integer, Optional Fun As Integer = 0, Optional StateCode As Integer = 0, Optional StateName As String = "", Optional AutoChange As Integer = 0, Optional Time As String = "", 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)) If Fun = 1 Then If axCZKEM1.SSR_SetShortkey(ShortKeyID, Fun, StateCode, StateName, AutoChange, Time) = True Then axCZKEM1.RefreshData(MachineNumber) 'the data in the device should be refreshed MsgBox("SetShortkey! ShortKeyID=" + ShortKeyID.ToString(), MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If Else StateCode = 0 StateName = "" AutoChange = 0 Time = "" If axCZKEM1.SSR_SetShortkey(ShortKeyID, Fun, StateCode, StateName, AutoChange, Time) = True Then axCZKEM1.RefreshData(MachineNumber) 'the data in the device should be refreshed MsgBox("SetShortkey! ShortKeyID=" + ShortKeyID.ToString(), MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If End If End Sub