📄 timeout.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
namespace xajh.chat
{
/// <summary>
/// timeout 的摘要说明。
/// </summary>
public class timeout : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if (this.Session["info"] == null)
{
this.Server.Transfer ("../error.aspx?v=relogin");
}
x.UserInfo info = (x.UserInfo) this.Session["info"];
if (info.RoomID == "false")
{
this.Server.Transfer ("../error.aspx?v=outchat");
}
string[] aword = new string[9];
aword[0] = "del";
aword[1] = info.UserName;
aword[2] = "";
aword[3] = "";
aword[4] = "";
aword[5] = "";
aword[6] = var.public_timeout;
aword[7] = "超时";
aword[8] = DateTime.Now.ToLongTimeString();
this.Application.Lock();
((ArrayList) this.Application["byts_xajh_chat_online_" + info.RoomID]).Remove(info.UserName);
var.public_inchat --;
ArrayList words = (ArrayList) this.Application["byts_xajh_chat_words_" + info.RoomID];
words.Add(aword);
words.RemoveAt(0);
this.Application["byts_xajh_chat_line_" + info.RoomID] = (int) this.Application["byts_xajh_chat_line_" + info.RoomID] + 1;
this.Application.UnLock();
info.RoomID = "false";
this.Session["info"] = info;
this.Session.Abandon();
this.Server.Transfer ("../error.aspx?v=你长时间没有发言,为了释放服务器资源,服务器已经与你断开连接!");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -