public void SendToServer(string json) { if (CommState.GetState() != (int)VisCommState.StateEnum.Running) { throw new Exception("客户端不处于运行状态,无法正常收发!"); } try { upCast.SendMsg(json); } catch (Exception) { throw; } }
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("请输入信息!"); } }
public void SendToServer(string json) { upCast.SendMsg(json); }