using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;//聊天消息类public class Msg{ private string _UserName = "系统";//消息发送者 private string _OtherName = "所有人";//消息接收者 private string _Message;//消息 private DateTime _DateTime;//发送时间 private string _Img = "";//表情图片 private string _IsBold = "0";//是否黑体(斜体) private string _Color = null;//消息的颜色 public DateTime DateTime//消息发送时间 { get { return this._DateTime; } } public string UserName//消息发送者 { get { return this._UserName; } } public string Message//消息 { get { return this._Message; } } public string OtherName//消息接收者 { get { return _OtherName; } } public string IsBold//是否黑体(斜体)1代表黑体 2代表斜体 { get { return _IsBold; } } public string Color//消息的颜色 { get { return _Color; } } public string Img//消息附加的表情图片 { get { return _Img; } } //聊天消息初始化函数 public Msg(string userName, string othername, string message, string isbold, string color, string img) { this._UserName = userName; this._OtherName = othername; this._Message = message; this._IsBold = isbold; this._Color = color; this._Img = img; this._DateTime = DateTime.Now; } public Msg(string msg)//系统消息初始化函数 { this._Message = msg; this._DateTime = DateTime.Now; }}

评论