📄 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);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -