123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ToolsClassLibrary.UDP
- {
- [Serializable]
- public class Msg
- {
- //所属用户的用户名
- public string name { get; set; }
- //所属用户的ip
- public string host { get; set; }
- //命令的名称
- public string command { get; set; }
- //收信人的姓名
- public string desname { get; set; }
- //你所发送的消息的目的地ip,应该是对应在服务器的列表里的主键值
- public string destinationIP { get; set; }
- //端口号
- public int port { get; set; }
- //文本消息
- public string msg { get; set; }
- //二进制消息
- public byte[] byte_msg { get; set; }
- //附加数据
- public string extend_msg { get; set; }
- //时间戳
- public DateTime time { get; set; }
- //构造函数
- public Msg(string command, string desip, string msg, string host)
- {
- this.command = command;
- this.destinationIP = desip;
- this.msg = msg;
- this.time = DateTime.Now;
- this.host = host;
- }
- override
- public string ToString()
- {
- return name + "说:" + msg;
- }
- }
- }
|