C常用算法程序集,一部比较经典的程序算法合集
源代码在线查看: message.cs
using System;
using System.Collections.Generic;
using System.Text;
namespace mychat1
{
public struct Message
{
private readonly string userName;
private readonly string content;
private readonly DateTime postDate;
public Message(string userName, string content)
{
this.userName = userName;
this.content = content;
this.postDate = DateTime.Now;
}
public Message(string content) : this("System", content) { }
public string UserName
{
get { return userName; }
}
public string Content
{
get { return content; }
}
public DateTime PostDate
{
get { return postDate; }
}
public override string ToString()
{
return String.Format("{0}[{1}]:\r\n{2}\r\n", userName, postDate, content);
}
}
}