/// <summary> /// 发送消息 /// </summary> /// <param name="SendMsg">消息内容</param> /// <returns>消息是否发送成功</returns> public bool MessageSend(MessageStruct SendMsg) { if (_udpSend == null) { return(false); } byte[] buffer = System.Text.Encoding.UTF8.GetBytes(SendMsg.ToString()); _udpSend.SendTo(buffer, _udpSendIPEndPoint); return(true); }