用到什么技术,给几个博客,有简单的例子当然最好了

解决方案 »

  1.   

    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();
        }
    }
      

  2.   

    CSDN上就有很多例子的,在下载资源里搜一搜
      

  3.   

    直接在MSDN里 搜索 SOCKET就有了 很多例子
      

  4.   

    我这有个“Socket 多人聊天室”不知道是不是你想要的
      

  5.   

    http://download.csdn.net/source/1760546  你可以去看看