public void loadConfig(int read) { this.defCC(); if ((HttpContext.Current.Application["loadconfig"] == null) || (read == 1)) { XmlControl control = new XmlControl(HttpContext.Current.Server.MapPath("~") + @"\config\config.config"); HttpContext.Current.Application.Clear(); HttpContext.Current.Application.RemoveAll(); HttpContext.Current.Application.Add("web.open", control.GetContent("config/web/open")); HttpContext.Current.Application.Add("web.url", control.GetContent("config/web/url")); HttpContext.Current.Application.Add("web.forum", control.GetContent("config/web/forum")); HttpContext.Current.Application.Add("web.servername", control.GetContent("config/web/servername")); HttpContext.Current.Application.Add("web.title", control.GetContent("config/web/title")); HttpContext.Current.Application.Add("web.keywords", control.GetContent("config/web/keywords")); HttpContext.Current.Application.Add("web.description", control.GetContent("config/web/description")); HttpContext.Current.Application.Add("web.count", control.GetContent("config/web/count")); HttpContext.Current.Application.Add("web.icpinfo", control.GetContent("config/web/icpinfo")); HttpContext.Current.Application.Add("web.closetext", control.GetContent("config/web/closetext")); HttpContext.Current.Application.Add("alipay.email", control.GetContent("config/alipay/email")); HttpContext.Current.Application.Add("alipay.partner", control.GetContent("config/alipay/partner")); HttpContext.Current.Application.Add("alipay.key", control.GetContent("config/alipay/key")); if (HttpContext.Current.Application["web.open"].ToString() == "false") { return; } HttpContext.Current.Application.Add("db.debug", control.GetContent("config/db/debug")); HttpContext.Current.Application.Add("db.connect", this.Decrypt(control.GetContent("config/db/connect"), "wfwfwfwf")); DataProviders providers = new DataProviders(); HttpContext.Current.Application.Add("game.modifychanamecount", control.GetContent("config/game/modifychanamecount")); HttpContext.Current.Application.Add("game.modifychanamemoney", control.GetContent("config/game/modifychanamemoney")); HttpContext.Current.Application.Add("game.charesetcount", control.GetContent("config/game/charesetcount")); HttpContext.Current.Application.Add("game.charesetgivepoint", control.GetContent("config/game/charesetgivepoint")); HttpContext.Current.Application.Add("game.charesetflv", control.GetContent("config/game/charesetflv")); HttpContext.Current.Application.Add("game.charesetlvstep", control.GetContent("config/game/charesetlvstep")); HttpContext.Current.Application.Add("game.charesetfmoney", control.GetContent("config/game/charesetfmoney")); HttpContext.Current.Application.Add("game.charesetmoneystep", control.GetContent("config/game/charesetmoneystep")); HttpContext.Current.Application.Add("game.commendmoney", control.GetContent("config/game/commendmoney")); HttpContext.Current.Application.Add("game.commendgold", control.GetContent("config/game/commendgold")); HttpContext.Current.Application.Add("game.commendreborn", control.GetContent("config/game/commendreborn")); HttpContext.Current.Application.Add("game.clearpkgold", control.GetContent("config/game/clearpkgold")); HttpContext.Current.Application.Add("game.petlvupgold2", control.GetContent("config/game/petlvupgold2")); HttpContext.Current.Application.Add("game.petlvupgold3", control.GetContent("config/game/petlvupgold3")); HttpContext.Current.Application.Add("game.skilllvupmoney", control.GetContent("config/game/skilllvupmoney")); HttpContext.Current.Application.Add("game.goldtomoney", control.GetContent("config/game/goldtomoney")); HttpContext.Current.Application.Add("game.vipoffer", control.GetContent("config/game/vipoffer")); HttpContext.Current.Application.Add("game.resetpointmoney", control.GetContent("config/game/resetpointmoney")); HttpContext.Current.Application.Add("game.resetpointgold", control.GetContent("config/game/resetpointgold")); HttpContext.Current.Application.Add("game.pssigngold", control.GetContent("config/game/pssigngold")); HttpContext.Current.Application.Add("game.changeinfogold", control.GetContent("config/game/changeinfogold")); HttpContext.Current.Application.Add("security.cpallowip", control.GetContent("config/security/cpallowip")); HttpContext.Current.Application.Add("security.blockip", control.GetContent("config/security/blockip")); HttpContext.Current.Application.Add("security.verifycode", control.GetContent("config/security/verifycode")); HttpContext.Current.Application.Add("register.allow", control.GetContent("config/register/allow")); HttpContext.Current.Application.Add("register.givegold", control.GetContent("config/register/givegold")); HttpContext.Current.Application.Add("register.stopregtext", control.GetContent("config/register/stopregtext")); HttpContext.Current.Application.Add("notice", providers.ExecScalarOne("select notice from web_notice ")); HttpContext.Current.Application.Add("sell", providers.ExecScalarOne("select sell from web_notice ")); HttpContext.Current.Application.Add("commendtext", providers.ExecScalarOne("select commend from mhcmember..web_notice")); HttpContext.Current.Application.Add("loadconfig", true); } if (HttpContext.Current.Request.QueryString["sid"] != null) { HttpContext.Current.Session["sid"] = "allowArea"; } if (new AllowIP().ScopeIncludingIpAddress(this.GetClientIP()) && (HttpContext.Current.Request.QueryString["sid"] == null)) { if (HttpContext.Current.Application["web.servername"].ToString().Equals("[墨香世界]")) { HttpContext.Current.Response.Redirect("http://www.skymso.com/notice.aspx", true); } if (HttpContext.Current.Application["web.servername"].ToString().Equals("[寶寶墨香]")) { HttpContext.Current.Response.Redirect("http://www.50mso.com/notice.aspx", true); } } if ((HttpContext.Current.Application["web.servername"].ToString().Equals("[51墨香]") && !new AllowIP().ScopeIncludingIpAddressx(this.GetClientIP())) && (HttpContext.Current.Request.QueryString["sid"] == null)) { HttpContext.Current.Response.Redirect("http://www.50mso.com/notice.aspx", true); } }
private void Page_Load(object sender, EventArgs e) { if (this.Session["useridx"] != null) { if (!this.Page.IsPostBack) { this.DropDownList1.DataSource = new DataProviders().ExecuteSqlDs("select character_idx,character_name from mhgame..tb_character where substring(character_name,1,1)!='@' and user_idx=" + this.Session["useridx"].ToString(), "DropDownList1"); this.DropDownList1.DataTextField = "character_name"; this.DropDownList1.DataValueField = "character_idx"; this.DropDownList1.DataBind(); for (int i = 0; i < this.DropDownList1.Items.Count; i++) { this.DropDownList1.Items[i].Text = new system().ConvertToBig5(this.DropDownList1.Items[i].Text.ToString(), 950); } } } else { base.Response.Redirect("login.aspx?returnurl=/shop.aspx"); } if (base.Request.QueryString["id"] != null) { DataProviders providers = new DataProviders(); id = int.Parse(base.Request.QueryString["ID"]); SqlDataReader reader = providers.ExecuteSqlDataReader("select a.*,b.isbb from web_item a,web_itemtype b where a.type=b.id and a.id=" + id); if (reader.Read()) { this.name = reader["name"].ToString(); this.comment = reader["comment"].ToString(); itemid = int.Parse(reader["itemid"].ToString()); this.isbb = int.Parse(reader["isbb"].ToString()); this.pic = reader["pic"].ToString(); this.price = float.Parse(reader["price"].ToString()); this.gold = float.Parse(reader["gold"].ToString()); this.iprice = (int)this.price; this.igold = (int)this.gold; this.priceoffer = (int)(this.price * float.Parse(base.Application["game.vipoffer"].ToString())); this.goldoffer = (int)(this.gold * float.Parse(base.Application["game.vipoffer"].ToString())); p = (int)this.price; g = (int)this.gold; if (this.Session["weblevel"].ToString() == "1") { p = this.priceoffer; g = this.goldoffer; this.vip = "黃金會員"; } if (this.Session["weblevel"].ToString() == "2") { p = this.priceoffer; g = this.goldoffer; this.vip = "白金會員"; } if (this.Session["weblevel"].ToString() == "3") { p = this.priceoffer; g = this.goldoffer; this.vip = "鑽石會員"; } else if (this.Session["weblevel"].ToString() == "0") { p = (int)this.price; g = (int)this.gold; this.vip = "普通會員"; } } else { reader.Close(); providers.CloseConn(); base.Response.Redirect("shop.aspx"); } reader.Close(); providers.CloseConn(); } else { base.Response.Redirect("shop.aspx"); } }