예제 #1
0
        public void SendToServer(string json)
        {
            if (CommState.GetState() != (int)VisCommState.StateEnum.Running)
            {
                throw new Exception("客户端不处于运行状态,无法正常收发!");
            }

            try
            {
                upCast.SendMsg(json);
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #2
0
        private void btnSend_Click(object sender, System.EventArgs e)
        {
            if (txtInfo.Text != string.Empty)
            {
                CommObj commObj = new CommObj(0x10,
                                              0x01,
                                              DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
                                              "string",
                                              txtInfo.Text);

                string json = CommObj.ToJson(commObj);
                upCast.SendMsg(json);

                ILog log = log4net.LogManager.GetLogger("server.Logging");
                log.Info("upCast.SendMsg--" + json);
            }
            else
            {
                MessageBox.Show("请输入信息!");
            }
        }
예제 #3
0
파일: RobotComm.cs 프로젝트: jagict/UR-V1.5
 public void SendToServer(string json)
 {
     upCast.SendMsg(json);
 }