📄 talk.aspx.cs
字号:
/*
* 对在asp.net2.0下利用ajax实现无刷新网页聊天技术原理的探索
* 作者:Gary
* 本小聊天室纯属自娱自乐
* 仅仅是完成了聊天室的基本原理的探索
* 没有注重资源的调解和功能的完善
* http://edidu.cnblogs.com
* 技术支持:asp.net2.0 + Ajax
* 关键字:asp.net2.0 ajax timer updatepanel application session
-*/
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Management;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Application["TalkContent"] = "Hello Gary!";
Label1.Text = Application["TalkContent"].ToString ();
//Application["TalkContent"] = "";
Page.Title = "Hello " + Session["Name"].ToString ()+" WelCome to Talkroom!";
}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text == "")
return;
Application["TalkContent"] += Session["Name"] +" Say: "+ TextBox1.Text + "<br>";
Label1.Text = Application["TalkContent"].ToString ();
TextBox1.Text = string.Empty;
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Label1.Text = Application["TalkContent"].ToString();
//
// 到一定的限度,清屏
//
if (Application["TalkContent"].ToString().Length > 2000)
Application["TalkContent"] = "";
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -