Set the time slots of a user. Time slots are separated by ":". The only difference between this function and SetUserTZs is the format of imported time slot index.
Device number
User ID
For details, see GetUserTZStr.
Return True if it is successful, or return False.
GetUserTZStr, SetUserTZs
//Create Standalone SDK class dynamicly. zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass(); int iMachineNumber = 1; axCZKEM1.Connect_Net("10.0.0.43", 4370); int idwErrorCode = 0; int iUserID = 1; string sTZs = ":::57440"; if (axCZKEM1.SetUserTZStr(iMachineNumber, iUserID, sTZs))//TZs is in strings. { axCZKEM1.RefreshData(iMachineNumber);//the data in the device should be refreshed MessageBox.Show("SetUserTZStr, UserID:" + iUserID.ToString() + " TimeZones:" + sTZs, "Success"); } else { axCZKEM1.GetLastError(ref idwErrorCode); MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error"); }
'Create Standalone SDK class dynamicly. Dim axCZKEM1 As New zkemkeeper.CZKEM Dim iMachineNumber As Integer axCZKEM1.Connect_Net("10.0.0.43", 4370) Dim idwErrorCode As Integer Dim iUserID As Integer = 1 Dim sTZs As String = ":::57440" If axCZKEM1.SetUserTZStr(iMachineNumber, iUserID, sTZs) = True Then 'TZs is in strings. axCZKEM1.RefreshData(iMachineNumber) 'the data in the device should be refreshed MsgBox("SetUserTZStr, UserID:" + iUserID.ToString() + " TimeZones:" + sTZs, MsgBoxStyle.Information, "Success") Else axCZKEM1.GetLastError(idwErrorCode) MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error") End If