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

public class Content : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Session.Timeout = 60;
Response.Write("欢迎 . . .<br>\n");
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 &;amp;&;amp; Response.IsClientConnected)
{
Response.Write(TextBox1.Text  "<br>\n");
Response.Flush();
}
else
{
Application.Remove(name);
}
}
}
}

 感谢原创者的辛勤劳动,希望对您有所帮助,转载请注明原出处。
 您可能对 [Asp.Net] 的这些文章也感兴趣:

.Net开发过程中安装、调试的常见问题与错误!!!
Windows.NET Server: XML Web 服务
ASP.NET MVC Preview 5 演示Demo #7
Server对象之HtmlEncode和UrlEncode的用法
ASP.net发送Email
Attribute在.net编程中的应用(四)
ASP.NET Interview Questions
XCodeFactory 强化静态检查!
ASP.NET中Cookie编程的基础知识(6)
在服务器端保存ViewState