예제 #1
0
        private void ReportError()
        {
            string temp = string.Format("\"success\":\"0\"");

            string res = "{\"TYPE\":\"TRACKIDPOWER\"," + temp + "}";

            tcpListenerServer.SendMessageToClient(res);
        }
예제 #2
0
        //从页面得到数据了,解析并发送到LED
        void SendToLED()
        {
            if (ConstructFormatedString())
            {
                int initRes = 0;

                if (bInitSuccess)
                {
                    //{"TYPE":"LED","IP" : "192.168.1.100", "PORT":"1023" , "LEDDATA": ["32*32&&黄&&欢迎公司领导检查指导!","16*16&&黄&&Hello!"] }

                    ledCom.IP      = IPdata["IP"];
                    ledCom.UDPPort = Convert.ToUInt32(IPdata["PORT"]);

                    initRes = ledCom.SendTextToLED() == 0 ? 1 : 0;

                    ledCom.CleanFormatedContentText();

                    if (0 == initRes)
                    {
                        LogHelper.WriteWithMethod("发送到LED失败!");
                    }

                    string temp = string.Format("\"success\":\"{0}\"", initRes.ToString());
                    //string.Format("{\"TYPE\":\"LED\",\"success\":\"{0}\"}", initRes.ToString())
                    string res = "{\"TYPE\":\"LED\"," + temp + "}";


                    tcpListenerServer.SendMessageToClient(res);
                    //{"TYPE":"LED","success":"{0}"}
                }

                ledDataCollection.Clear();
            }
        }