⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menu.aspx.cs

📁 ASP.NET构建的笑傲江湖社区(C#,全源码提供)
💻 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.chat
{
	/// <summary>
	/// menu 的摘要说明。
	/// </summary>
	public class menu : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Literal rooms;
		protected System.Web.UI.WebControls.Literal streets;
		protected System.Web.UI.WebControls.Literal thingtype;
		protected System.Web.UI.WebControls.Panel myclass1;
		protected System.Web.UI.WebControls.Panel myclass2;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (this.Session["info"] == null)
			{
				return;
			}
			x.UserInfo info = (x.UserInfo) this.Session["info"];
			if (info.RoomID == "false")
			{
				return;
			}
			if (info.MyClass == "(无)")
			{
				this.myclass1.Visible = true;
				this.myclass2.Visible = false;
			}
			else
			{
				this.myclass1.Visible = false;
				this.myclass2.Visible = true;
			}
			ArrayList roomlist = var.public_roomlist;
			string roomstr = "";
			for (int i = 0; i < roomlist.Count; i ++ )
			{
				x.RoomInfo roominfo = (x.RoomInfo) this.Application["byts_xajh_chat_roominfo_" + roomlist[i]];
				roomstr += "{| " + roominfo.RoomName + "}\r";
				roomstr += "{|| 进入此房间,javascript:parent.h0.byts_goroom(" + roomlist[i] + "),_}\r";
				roomstr += "{||-}\r";
				roomstr += "{|| 查看在线名单,javascript:parent.h0.byts_displayonline('" + roomlist[i] + "'),_}\r";
				roomstr += "{|| 存档系统参数,javascript:parent.h0.byts_roominfo_2(" + roomlist[i] + "),_}\r";
				roomstr += "{|| 查看进入限制}\r";
				roomstr += "{||| 等级限制:" + this.StrFactory(roominfo.MinGrade) + "~" + this.StrFactory(roominfo.MaxGrade) + ",_,_}\r";
				roomstr += "{||| 战级限制:" + this.StrFactory(roominfo.MinFGrade) + "~" + this.StrFactory(roominfo.MaxFGrade) + ",_,_}\r";
				roomstr += "{||| 会员限制:" + this.StrFactory(roominfo.MinGGrade) + "~" + this.StrFactory(roominfo.MaxGGrade) + ",_,_}\r";
				if (roominfo.CheckSex != "boy" && roominfo.CheckSex != "girl")
				{
					roomstr += "{||| 性别限制:(无限制),_,_}\r";
				}
				else
				{
					roomstr += "{||| 性别限制:" + roominfo.CheckSex + ",_,_}\r";
				}
				roomstr += "{|||-}\r";
				roomstr += "{||| 详细限制,javascript:parent.h0.byts_roominfo_1(" + roomlist[i] + "),_}\r";
				roomstr += "{||-}\r";
				if (roominfo.MaxOnline != -1)
				{
					roomstr += "{|| 最大在线:" + roominfo.MaxOnline + "人,_,_}\r";
				}
				else
				{
					roomstr += "{|| 最大在线:(无限制),_,_}\r";
				}
				roomstr += "{|| 随机事件:" + this.Application["byts_xajh_chat_ranthing_" + roomlist[i]] + " %,_,_}\r";
				roomstr += "{|| 允许动武:" + this.checkdis(roominfo.CanUseWG) + ",_,_}\r";
				roomstr += "{|| 物品使用:" + this.checkdis(roominfo.CanUseThing) + ",_,_}\r";
				roomstr += "{|| 允许管理:" + this.checkdis(roominfo.CanManage) + ",_,_}\r";
			}
			this.rooms.Text = roomstr;
			string thingtype = "";
			string[] things = var.public_shoptype.Split('|');
			foreach (string str in things)
			{
				thingtype += "{| " + str + ",javascript:parent.h0.byts_gourl('chat/mythings.aspx?showkind=" + str + "'),_}\r";
			}
			this.thingtype.Text = thingtype;
			string streetstr = "";
			string[] street = var.public_streettype.Split('|');
			foreach (string str in street)
			{
				streetstr += "{| " + str + ",javascript:parent.h0.byts_openstreet('" + str + "'),_}\r";
			}
			streetstr += "{|-}\r";
			string[] shop = var.public_shoptype.Split('|');
			foreach (string str in shop)
			{
				streetstr += "{| " + str + "商店,javascript:parent.h0.byts_openshop('" + str + "'),_}\r";
			}
			this.streets.Text = streetstr;
		}

		private string StrFactory(int v)
		{
			if (v == -1)
			{
				return "..";
			}
			else
			{
				return v.ToString();
			}
		}

		private string checkdis(bool v)
		{
			if (v == true)
			{
				return "允许";
			}
			else
			{
				return "禁止";
			}
		}
		#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 + -