📄 welcome.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace xajh
{
/// <summary>
/// welcome 的摘要说明。
/// </summary>
public class welcome : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Literal byts_title;
protected System.Web.UI.WebControls.Literal byts_sn;
protected System.Web.UI.WebControls.Literal byts_roomlist;
protected System.Web.UI.WebControls.Literal byts_street;
protected System.Web.UI.WebControls.Literal byts_shop;
protected System.Web.UI.WebControls.LinkButton byts_exit;
protected System.Web.UI.WebControls.Label byts_welcome;
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
if (this.Session["info"] == null)
{
this.Server.Transfer ("error.aspx?v=relogin");
}
x.UserInfo info = (x.UserInfo) this.Session["info"];
if (this.Request.Cookies["byts"] == null || info.UserName != this.Request.Cookies["byts"]["chat"])
{
this.Session.Abandon();
this.Server.Transfer ("error.aspx?v=请不要同时使用两个名字登陆或中途删除cookie!");
}
string sex;
switch (info.Sex)
{
case "boy":
sex = "大侠";
break;
case "girl":
sex = "侠女";
break;
default:
sex="";
break;
}
this.byts_title.Text = var.public_name + " (授权给:" + var.public_user + ",序列号:" + var.public_sn + ")";
this.byts_sn.Text = var.public_sn;
this.byts_welcome.Text = "欢迎" + sex + " <font class=\"byts\">" + info.UserName + "</font> 闯荡江湖!  (" + var.public_online + " 在线 / " + var.public_inchat + " 聊天)";
string a_roomlist = "<script language=javascript type=text/javascript>\r";
ArrayList roomlist = var.public_roomlist;
for (int i = 0; i < roomlist.Count; i ++)
{
x.RoomInfo roominfo = (x.RoomInfo) Application["byts_xajh_chat_roominfo_" + roomlist[i]];
a_roomlist += "showroominfo(\"" + roomlist[i] + "\",\"" + ((ArrayList) this.Application["byts_xajh_chat_online_" + roomlist[i]]).Count + "\",\"" + roominfo.RoomName + "\",\"" + this.Application["byts_xajh_chat_ranthing_" + roomlist[i]] + "\",\"" + roominfo.CanUseWG + "\",\"" + roominfo.CanUseThing + "\",\"" + roominfo.CanManage + "\",\"" + roominfo.MaxOnline + "\");\r";
}
a_roomlist += "</script>";
this.byts_roomlist.Text = a_roomlist;
this.byts_street.Text = var.public_streettype;
this.byts_shop.Text = var.public_shoptype;
}
}
private void byts_exit_Click(object sender, System.EventArgs e)
{
this.Session.Abandon();
this.Response.Redirect ("default.aspx");
}
#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.byts_exit.Click += new System.EventHandler(this.byts_exit_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -