GetTZInfo

Definition

Usage

Obtain the information of the time slot with the specified number.

Parameter

Device number

Time slot index

Time slot with the index described by TZIndex. Every eight bits represent a time slot,

in format of hhmmhhmm. For example,

10111223000023590000235900002359000023590000235900002359 indicates a

time slot covering the whole day from Monday to Saturday and from 10:11 to 12:23 of

Sunday.

Return Value

Return True if it is successful, or return False.

Related Function

SetTZInfo

 

Ejemplo

C#

/// <summary>
    /// Get the timezone information by the specified timezone number 
    /// </summary>
    /// <param name="iTZIndex">Time slot index</param>
    /// <param name="TZ">Time slot with the index described by TZIndex. Every eight bits represent a time slot,
    /// in format of hhmmhhmm.For example,
    /// 10111223000023590000235900002359000023590000235900002359 indicates a
    /// time slot covering the whole day from Monday to Saturday and from 10:11 to 12:23 of
    /// Sunday.</param>
    /// <param name="IP"> Ip of device </param>
    /// <param name="Port"> Port of Device </param>
    /// <param name="MachineNumber"> Device Number </param>
    private void GetTZInfo(int TZIndex, string TZ = "", 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.GetTZInfo(MachineNumber, TZIndex, ref TZ))
            {
                MessageBox.Show("The TZInfo is:" + TZIndex.ToString(), "Success");
            }
    else
            {
                axCZKEM1.GetLastError(ref idwErrorCode);
                MessageBox.Show("Operation failed,ErrorCode=" + idwErrorCode.ToString(), "Error");
            }
        }

VB

    ''' <summary>
    ''' Get the timezone information by the specified timezone number 
    ''' </summary>
    ''' <param name="TZIndex">Time slot index</param>
    ''' <param name="TZ">Time slot with the index described by TZIndex. Every eight bits represent a time slot,
    ''' in format of hhmmhhmm. For example,
    ''' 10111223000023590000235900002359000023590000235900002359 indicates a
    ''' time slot covering the whole day from Monday To Saturday And from 10:11 to 12:23 of
    ''' Sunday.</param>
    ''' <param name="IP"> Ip of device </param>
    ''' <param name="Port"> Port of Device </param>
    ''' <param name="MachineNumber"> Device Number </param>
    Private Sub GetTZInfo(TZIndex As Integer, TZ 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.GetTZInfo(MachineNumber, TZIndex, TZ) = True Then
            MsgBox("The TZInfo Is" & TZIndex.ToString(), MsgBoxStyle.Information, "Success")
    Else
            axCZKEM1.GetLastError(idwErrorCode)
            MsgBox("Operation failed,ErrorCode=" & idwErrorCode.ToString(), MsgBoxStyle.Exclamation, "Error")
    End If
    End Sub