谁做过C#聊天系统 用到什么技术,给几个博客,有简单的例子当然最好了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (Application["chatMsg"] != null) { Label1.Text = Application["chatMsg"].ToString(); } } protected void Button1_Click(object sender, EventArgs e) { if (TextBox2.Text=="") { Label2.Text = "请输入姓名!"; } else { if (Session["dt"] != null) { TimeSpan ts = DateTime.Now - (DateTime)Session["dt"]; if (ts.TotalSeconds < 3) { Label2.Text=("发送消息过快;消息间隔三秒钟"); return; } } Application.Set("chatMsg", Application["chatMsg"] + "<br>" + TextBox2.Text + " 说:" + TextBox1.Text); Session["dt"] = DateTime.Now; TextBox1.Text = string.Empty; Label1.Text = Application["chatMsg"].ToString(); } } protected void Timer1_Tick(object sender, EventArgs e) { if (Application["chatMsg"] != null) Label1.Text = Application["chatMsg"].ToString(); }} CSDN上就有很多例子的,在下载资源里搜一搜 直接在MSDN里 搜索 SOCKET就有了 很多例子 我这有个“Socket 多人聊天室”不知道是不是你想要的 http://download.csdn.net/source/1760546 你可以去看看 DataRelation建立后,DataGridView中显示不出来 关于字典问题 关于两数组组合算法,请教,谢谢! 高分求一个好用的条形码控件 c#的web程序启动时,如何默认窗口最大化 谁能告诉我电影网址吗?100分 Win2000下为什么不能运行? 怎样把字符串转换成真正的数字? access数据库更新问题 自定义控件如何继承Table的所有属性 文本信息提取 怎样treeNode后加按钮
{
protected void Page_Load(object sender, EventArgs e)
{
if (Application["chatMsg"] != null)
{
Label1.Text = Application["chatMsg"].ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox2.Text=="")
{
Label2.Text = "请输入姓名!";
}
else
{ if (Session["dt"] != null)
{
TimeSpan ts = DateTime.Now - (DateTime)Session["dt"];
if (ts.TotalSeconds < 3)
{
Label2.Text=("发送消息过快;消息间隔三秒钟");
return;
}
}
Application.Set("chatMsg", Application["chatMsg"] + "<br>" + TextBox2.Text + " 说:" + TextBox1.Text);
Session["dt"] = DateTime.Now; TextBox1.Text = string.Empty;
Label1.Text = Application["chatMsg"].ToString();
} }
protected void Timer1_Tick(object sender, EventArgs e)
{
if (Application["chatMsg"] != null)
Label1.Text = Application["chatMsg"].ToString();
}
}