首页 > 学院 > 开发设计 > 正文

如何使用ASP.NET开发基于推技术的聊天室?

2019-11-17 01:56:10
字体:
来源:转载
供稿:网友

如何使用asp.net开发基于推技术的聊天室?

public class Content : System.Web.UI.Page{PRivate void Page_Load(object sender, System.EventArgs e){session.Timeout = 60;Response.Write("欢迎 . . .<br> ");Response.Flush();application[Session.SessionID] = Response;System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);}}// Send.aspx.cs //////////////////////////////////////////////////////////public class Send : System.Web.UI.Page{protected System.Web.UI.WebControls.Button ButtonSend;protected System.Web.UI.WebControls.TextBox TextBox1;private void ButtonSend_Click(object sender, System.EventArgs e){foreach(string name in Application.AllKeys){HttpResponse Response = Application[name] as HttpResponse;if(Response!=null && Response.IsClientConnected){Response.Write(TextBox1.Text + "<br> ");Response.Flush();}else{Application.Remove(name);}}}}


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表