📄 error.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace xajh
{
/// <summary>
/// error 的摘要说明。
/// </summary>
public class error : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label err_v;
protected System.Web.UI.WebControls.Literal js;
protected System.Web.UI.WebControls.Literal byts_title;
protected string ProgramPath;
private void Page_Load(object sender, System.EventArgs e)
{
ProgramPath = this.Request.ApplicationPath;
if (ProgramPath == "/")
{
ProgramPath = "";
}
string v = this.Request.QueryString["v"];
switch (v)
{
case null:
v = "该页面执行了非法操作!";
string ep = this.Request.QueryString["aspxerrorpath"];
if (this.Request.QueryString["aspxerrorpath"] != null)
{
v += "<br /><br />出错位置:" + ep;
}
this.js.Text = "if (window != window.top){alert('该页面执行了非法操作!\\r\\r出错位置:" + ep + "')}";
break;
case "relogin":
v = "尚未登陆或连接已经超时,请<a style=\"color:#0000FF\" href=\"" + ProgramPath + "/default.aspx\" target=\"_blank\" language=\"javascript\" onclick=\"window.close()\">重新登陆</a>!";
this.js.Text = "top.moveTo(0,0);top.resizeTo(screen.availWidth, screen.availHeight);if (window != window.top){top.location.href = '" + ProgramPath + "/error.aspx?v=relogin'}";
break;
case "outchat":
v = "你不在聊天室内,操作无法完成!";
break;
default:
v = v.Replace("{", "<font style=\"color:#FF0000\">").Replace("}", "</font>");
break;
}
this.byts_title.Text = "出错提示页面 --- " + var.public_name + " (授权给:" + var.public_user + ",序列号:" + var.public_sn + ")";
this.err_v.Text = 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 + -