Exemplo n.º 1
0
        /// <summary>
        /// 接收消息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnIotRecieve(object sender, CClient.CCMessageArgs e)
        {
            Iot_Count++;

            FrmClient.Subscribe("【Time】:" + DateTime.Now.ToString("HH:mm:ss.") + DateTime.Now.Millisecond.ToString("D3") + "\r\n", Color.Black);

            FrmClient.Subscribe("【Topic】:", Color.Black);

            FrmClient.Subscribe(e.topic + "\r\n", Color.Blue);

            FrmClient.Subscribe("【Message】:", Color.Black);

            FrmClient.Subscribe(e.message + "\r\n", Color.Green);

            FrmClient.Subscribe("---------------------------------->" + Iot_Count.ToString() + "\r\n", Color.DarkOrange);
        }
Exemplo n.º 2
0
        private void OnClientRecieve(object sender, CClient.CCMessageArgs e)
        {
            _nodeCount++;

            ShowClientLog("【Time】:" + DateTime.Now.ToString("HH:mm:ss.") + DateTime.Now.Millisecond.ToString("D3") + "\r\n", Color.Black);

            ShowClientLog("【Topic】:", Color.Black);

            ShowClientLog(e.topic + "\r\n", Color.Blue);

            ShowClientLog("【Message】:", Color.Black);

            ShowClientLog(e.message + "\r\n", Color.Green);

            ShowClientLog("--------------------------------------------------------------------------------------------------->" +
                          _nodeCount.ToString() + "\r\n", Color.DarkOrange);
        }