资源简介
asp.net制作的在线聊天室

代码片段和文件信息
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender EventArgs e)
{
if (!this.IsPostBack)
{
this.pnlLogin.Visible = true;
this.pnlWelcome.Visible = false;
this.pnlChat.Visible = false;
}
}
protected void btnLogin_Click(object sender EventArgs e)
{
if (this.txtUid.Text == ““)
{
return;
}
this.pnlLogin.Visible = false;
this.pnlWelcome.Visible = true;
this.pnlChat.Visible = true;
this.lblUid.Text = this.txtUid.Text;
Session[“uid“] = this.txtUid.Text;
}
protected void btnSend_Click(object sender EventArgs e)
{
Response.Cookies[“userName“].Value =this.txtChat.Text;
Response.Cookies[“userName“].Expires = DateTime.Now.AddDays(30);
string str = “[“ + Session[“uid“] + “]:“ + this.txtChat.Text;
Application.Lock();
Application[“msg“] = Application[“msg“] + “
“ + str;
Application.UnLock();
}
protected void Button1_Click(object sender EventArgs e)
{
this.TextBox1.Text = Application[“msg“].ToString();
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2297 2012-03-14 22:13 Chat\Default.aspx
文件 1543 2003-03-19 01:18 Chat\Default.aspx.cs
文件 1199 2012-03-14 22:02 Chat\Global.asax
文件 593 2012-03-18 19:16 Chat\msg.aspx
文件 491 2012-03-09 16:34 Chat\msg.aspx.cs
文件 8068 2012-03-09 16:40 Chat\web.config
文件 271 2012-03-09 11:45 Chat\作业.txt
目录 0 2012-05-21 22:39 Chat\App_Data
目录 0 2012-05-21 22:39 Chat
----------- --------- ---------- ----- ----
14462 9
评论
共有 条评论