public void RefreshDisselectableExpItem(EvolveMaterial item, uint totalCount) { InitComponent(); m_propInfo = ConfigManager.Get <PropItemInfo>(item.propId); if (m_propInfo == null) { return; } Util.SetItemInfo(m_itemObj, m_propInfo, 0, 0, false); bool enough = totalCount >= item.num; string totalStr = enough ? totalCount.ToString() : GeneralConfigInfo.GetNoEnoughColorString(totalCount.ToString()); Util.SetText(m_countText, ConfigText.GetDefalutString(TextForMatType.EquipIntentyUI, 16), totalStr, item.num); if (m_icon) { EventTriggerListener.Get(m_icon.gameObject).onClick = (obj) => { if (m_propInfo) { Module_Global.instance.SetTargetMatrial(m_propInfo.ID, (int)item.num); } } } ; } }
public void LoadConfigInfo() { #region 加载配置信息 string configFile = Server.MapPath("~/Config/general.config"); GeneralConfigInfo __configinfo = new GeneralConfigInfo(); if (File.Exists(configFile)) { __configinfo = GeneralConfigs.Deserialize(configFile); } watermarktype.SelectedValue = __configinfo.WaterMarkType.ToString(); watermarkfontsize.Text = __configinfo.WaterMarkFontSize.ToString(); watermarktext.Text = __configinfo.WaterMarkText.ToString(); watermarkpic.Text = __configinfo.WaterMarkPic.ToString(); watermarktransparency.Text = __configinfo.WaterMarkTransparency.ToString(); MaxWidthOfUploadedImgTextbox.Text = __configinfo.MaxWidthOfUploadedImg.ToString(); CuttoMaxCheckBox.Checked = __configinfo.CutToMaxWidthOfUploadedImg == 1; LoadPosition(__configinfo.WaterMarkStatus); LoadSystemFont(); try { watermarkfontname.SelectedValue = __configinfo.WaterMarkFontName.ToString(); } catch { watermarkfontname.SelectedIndex = 0; } #endregion }
public HelpPage() { GeneralConfigInfo config = GeneralConfigInfo.Current; this.forumtitle = config.Forumtitle; this.forumurl = config.Forumurl; }
private void SaveInfo_Click(object sender, EventArgs e) { #region 保存设置信息 if (this.CheckCookie()) { GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); configInfo.Seotitle = seotitle.Text; configInfo.Seokeywords = seokeywords.Text; configInfo.Seodescription = seodescription.Text; configInfo.Seohead = seohead.Text; configInfo.Archiverstatus = Convert.ToInt16(archiverstatus.SelectedValue); configInfo.Sitemapstatus = Convert.ToInt16(sitemapstatus.SelectedValue); configInfo.Sitemapttl = Convert.ToInt32(sitemapttl.Text); configInfo.Aspxrewrite = Convert.ToInt16(aspxrewrite.SelectedValue); GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config")); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "搜索引擎优化设置", ""); base.RegisterStartupScript("PAGE", "window.location.href='global_searchengine.aspx';"); } #endregion }
public void LoadConfigInfo() { #region 加载配置信息 GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config")); forumtitle.Text = __configinfo.Forumtitle.ToString(); forumurl.Text = __configinfo.Forumurl.ToString(); webtitle.Text = __configinfo.Webtitle.ToString(); weburl.Text = __configinfo.Weburl.ToString(); licensed.SelectedValue = __configinfo.Licensed.ToString(); icp.Text = __configinfo.Icp.ToString(); rssttl.Text = __configinfo.Rssttl.ToString(); sitemapttl.Text = __configinfo.Sitemapttl.ToString(); nocacheheaders.SelectedValue = __configinfo.Nocacheheaders.ToString(); debug.SelectedValue = __configinfo.Debug.ToString(); rssstatus.SelectedValue = __configinfo.Rssstatus.ToString(); sitemapstatus.SelectedValue = __configinfo.Sitemapstatus.ToString(); cachelog.SelectedValue = "0"; fulltextsearch.SelectedValue = __configinfo.Fulltextsearch.ToString(); passwordmode.SelectedValue = __configinfo.Passwordmode.ToString(); bbcodemode.SelectedValue = __configinfo.Bbcodemode.ToString(); extname.Text = __configinfo.Extname.Trim(); enablesilverlight.SelectedValue = __configinfo.Silverlight.ToString(); CookieDomain.Text = __configinfo.CookieDomain.ToString(); memliststatus.SelectedValue = __configinfo.Memliststatus.ToString(); Indexpage.SelectedIndex = Convert.ToInt32(__configinfo.Indexpage.ToString()); Linktext.Text = __configinfo.Linktext; Statcode.Text = __configinfo.Statcode; aspxrewrite.SelectedValue = __configinfo.Aspxrewrite.ToString(); #endregion }
public virtual IHttpHandler GetHandler(HttpContext context, string requestType, string newUrl, string path) { string pagepath = path; BaseConfigInfo baseconfig = BaseConfigs.GetBaseConfig(); GeneralConfigInfo config = GeneralConfigs.GetConfig(); if (baseconfig != null && config != null) { string requestPath = context.Request.Path.ToLower(); foreach (SiteUrls.URLRewrite url in SiteUrls.GetSiteUrls().Urls) { if (Regex.IsMatch(requestPath, url.Pattern, RegexOptions.IgnoreCase)) { if (url.Page != "") { string queryString = Regex.Replace(requestPath, url.Pattern, url.QueryString, RegexOptions.IgnoreCase); context.RewritePath(url.Page, string.Empty, queryString); pagepath = context.Server.MapPath(url.Page); break; } } } if (!newUrl.EndsWith(config.UrlExtName, true, null)) { newUrl += "default." + config.UrlExtName; } } return(PageParser.GetCompiledPageInstance(newUrl, pagepath, context)); }
/// <summary> /// 设置关于showforum页面链接的显示样式 /// </summary> /// <param name="forumid"></param> /// <param name="pageid"></param> /// <returns></returns> public static string ShowForumAspxRewrite(int forumid, int pageid) { GeneralConfigInfo config = GeneralConfigs.GetConfig(); //当使用伪aspx if (config.Aspxrewrite == 1) { if (pageid > 0) { return("showforum-" + forumid + "-" + pageid + config.Extname); } else { return("showforum-" + forumid + config.Extname); } } else { if (pageid > 0) { return("showforum.aspx?forumid=" + forumid + "&page=" + pageid); } else { return("showforum.aspx?forumid=" + forumid); } } }
/// <summary> /// 保存配置类实例 /// </summary> /// <param name="generalconfiginfo"></param> /// <returns></returns> public static bool SaveConfig(GeneralConfigInfo generalconfiginfo) { GeneralConfigFileManager gcf = new GeneralConfigFileManager(); GeneralConfigFileManager.ConfigInfo = generalconfiginfo; return(gcf.SaveConfig()); }
private void SaveInfo_Click(object sender, EventArgs e) { #region 保存设置信息 if (this.CheckCookie()) { GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); Hashtable TimeHash = new Hashtable(); TimeHash.Add("禁止访问时间段", visitbanperiods.Text); TimeHash.Add("禁止发帖时间段", postbanperiods.Text); TimeHash.Add("发帖审核时间段", postmodperiods.Text); TimeHash.Add("禁止下载附件时间段", attachbanperiods.Text); TimeHash.Add("禁止全文搜索时间段", searchbanperiods.Text); string key = ""; if (Utils.IsRuleTip(TimeHash, "timesect", out key) == false) { base.RegisterStartupScript("erro", "<script>alert('" + key.ToString() + ",时间格式错误');</script>"); return; } configInfo.Visitbanperiods = visitbanperiods.Text; configInfo.Postbanperiods = postbanperiods.Text; configInfo.Postmodperiods = postmodperiods.Text; configInfo.Searchbanperiods = searchbanperiods.Text; configInfo.Attachbanperiods = attachbanperiods.Text; GeneralConfigs.Serialiaze(configInfo, Server.MapPath("../../config/general.config")); AdminVistLogs.InsertLog(this.userid, this.username, this.usergroupid, this.grouptitle, this.ip, "时间段设置", ""); base.RegisterStartupScript("PAGE", "window.location.href='global_timespan.aspx';"); } #endregion }
public void LoadConfigInfo() { #region 加载配置信息 GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); attachrefcheck.SelectedValue = configInfo.Attachrefcheck.ToString(); attachsave.SelectedValue = configInfo.Attachsave.ToString(); attachimgpost.SelectedValue = configInfo.Attachimgpost.ToString(); watermarktype.SelectedValue = configInfo.Watermarktype.ToString(); showattachmentpath.SelectedValue = configInfo.Showattachmentpath.ToString(); attachimgmaxheight.Text = configInfo.Attachimgmaxheight.ToString(); attachimgmaxwidth.Text = configInfo.Attachimgmaxwidth.ToString(); attachimgquality.Text = configInfo.Attachimgquality.ToString(); watermarkfontsize.Text = configInfo.Watermarkfontsize.ToString(); watermarktext.Text = configInfo.Watermarktext.ToString(); watermarkpic.Text = configInfo.Watermarkpic.ToString(); watermarktransparency.Text = configInfo.Watermarktransparency.ToString(); LoadPosition(configInfo.Watermarkstatus); LoadSystemFont(); try { watermarkfontname.SelectedValue = configInfo.Watermarkfontname.ToString(); } catch { watermarkfontname.SelectedIndex = 0; } #endregion }
protected void Page_Load(object sender, EventArgs e) { this.config = GeneralConfigInfo.Current; if (!this.config.Adminipaccess.IsNullOrEmpty()) { string[] iparray = Utils.SplitString(this.config.Adminipaccess, "\n"); if (!Utils.InIPArray(WebHelper.UserHost, iparray)) { this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx"); return; } } var online = Online.UpdateInfo(); this.olid = online.ID; //var userGroupInfo = UserGroup.FindByID((int)online.GroupID); if (online.UserID <= 0 || !online.Group.Is¹ÜÀíÔ±) { this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx"); return; } string secques = Users.GetUserInfo(online.UserID).Secques; if (this.Context.Request.Cookies["bbx_admin"] == null || this.Context.Request.Cookies["bbx_admin"]["key"] == null || ForumUtils.GetCookiePassword(this.Context.Request.Cookies["bbx_admin"]["key"].ToString(), this.config.Passwordkey) != online.Password + secques + online.UserID) { this.Context.Response.Redirect(BaseConfigs.GetForumPath + "admin/syslogin.aspx"); return; } HttpCookie httpCookie = HttpContext.Current.Request.Cookies["bbx_admin"]; httpCookie.Values["key"] = ForumUtils.SetCookiePassword(online.Password + secques + online.UserID.ToString(), this.config.Passwordkey); httpCookie.Expires = DateTime.Now.AddMinutes(30.0); HttpContext.Current.Response.AppendCookie(httpCookie); }
public void LoadConfigInfo() { #region 加载配置信息 GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); InvitationConfigInfo invitationConfigInfo = InvitationConfigs.GetConfig(); regstatus.SelectedValue = configInfo.Regstatus.ToString(); censoruser.Text = configInfo.Censoruser; doublee.SelectedValue = configInfo.Doublee.ToString(); emaillogin.SelectedValue = configInfo.Emaillogin.ToString(); regverify.SelectedValue = configInfo.Regverify.ToString(); accessemail.Text = configInfo.Accessemail; censoremail.Text = configInfo.Censoremail; hideprivate.SelectedValue = configInfo.Hideprivate.ToString(); ipdenyaccess.Text = configInfo.Ipdenyaccess; ipaccess.Text = configInfo.Ipaccess; regctrl.Text = configInfo.Regctrl.ToString(); ipregctrl.Text = configInfo.Ipregctrl; adminipaccess.Text = configInfo.Adminipaccess; welcomemsg.SelectedValue = configInfo.Welcomemsg.ToString(); welcomemsgtxt.Text = configInfo.Welcomemsgtxt; rules.SelectedValue = configInfo.Rules.ToString(); rulestxt.Text = configInfo.Rulestxt; newbiespan.Text = configInfo.Newbiespan.ToString(); realnamesystem.SelectedValue = configInfo.Realnamesystem.ToString(); invitecodeexpiretime.Text = invitationConfigInfo.InviteCodeExpireTime.ToString(); invitecodemaxcount.Text = invitationConfigInfo.InviteCodeMaxCount.ToString(); addextcreditsline.Text = invitationConfigInfo.InviteCodePayCount.ToString(); invitationuserdescription.Text = invitationConfigInfo.InvitationLoginUserDescription;//配置项赋值给textarea的innnerhtml能保证显示出来的是所见即所得的效果 invitationvisitordescription.Text = invitationConfigInfo.InvitationVisitorDescription; invitationemailmodel.Text = invitationConfigInfo.InvitationEmailTemplate; invitecodeusermaxbuy.Text = invitationConfigInfo.InviteCodeMaxCountToBuy.ToString(); invitecodeusercreateperday.Text = invitationConfigInfo.InviteCodeUserCreatePerDay.ToString(); passwordmode.SelectedValue = configInfo.Passwordmode.ToString(); CookieDomain.Text = configInfo.CookieDomain.ToString(); string[] extCredits = Utils.SplitString(invitationConfigInfo.InviteCodePrice, ","); extCreditsUnits = Scoresets.GetValidScoreUnit(); DataTable extCreditsTable = Scoresets.GetScorePaySet(0); //初始化邀请码价格显示界面,全部为隐藏 for (int count = 0; count < 8; count++) { extCreditsName[count] = ""; TextBox textbox = this.FindControl("invitecodeprice" + count.ToString()) as TextBox; textbox.Text = extCredits[count]; textbox.Visible = false; } //根据邀请码相关信息,将有效的信息显示在界面中 foreach (DataRow dr in extCreditsTable.Rows) { extCreditsName[Utils.StrToInt(dr["id"].ToString(), 0) - 1] = dr["name"].ToString() + ":"; TextBox textbox = this.FindControl("invitecodeprice" + (Utils.StrToInt(dr[0].ToString(), 0) - 1).ToString()) as TextBox; textbox.Visible = true; } #endregion }
private void OnResetPanel() { var info = moduleGlobal.system.resetPrice; bool isContains = false; for (int i = 0; i < info.Length; i++) { if (info[i].times == modulePlayer.roleInfo.resetTimes + 1) { isContains = true; break; } } diamondPay = isContains ? info[modulePlayer.roleInfo.resetTimes + 1].price : info[0].price; if (modulePlayer.roleInfo.diamond >= diamondPay) { Util.SetText(remainText, Util.Format(Util.GetString((int)TextForMatType.TravalShopUIText, 11), diamondPay, modulePlayer.roleInfo.diamond)); } else { Util.SetText(remainText, GeneralConfigInfo.GetNoEnoughColorString(ConfigText.GetDefalutString(configID, 34)), diamondPay, modulePlayer.roleInfo.diamond); } int point = 0; if (!string.IsNullOrEmpty(m_Lv.text)) { point = Util.Parse <int>(m_Lv.text) * 3 - 3; } if (totalPoint == point) { moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.AttributeUIText, 21)); return; } m_ResetPanel.SafeSetActive(true); }
private void Refresh() { if (null == _chaseTask) { return; } int index = 0; index = _chaseTask.taskData.resetTimes >= _chaseTask.taskConfigInfo.dayRemainCount - 1 ? _chaseTask.taskConfigInfo.dayRemainCount - 1 : _chaseTask.taskData.resetTimes; if (index < 0 || index > _chaseTask.taskConfigInfo.cost.Length - 1) { return; } string[] str = _chaseTask.taskConfigInfo.cost[index].Split('-'); if (str.Length < 2) { return; } var prop = ConfigManager.Get <PropItemInfo>(Util.Parse <int>(str[0])); contentTip.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 30), str[1], prop.itemName); int remainCount = _chaseTask.taskConfigInfo.dayRemainCount - _chaseTask.taskData.resetTimes; currentDayCount.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 31), remainCount >= 0 ? remainCount : 0); AtlasHelper.SetItemIcon(costIcon, prop); bool canPay = modulePlayer.roleInfo.diamond >= Util.Parse <int>(str[1]); string colorStr = GeneralConfigInfo.GetNoEnoughColorString(modulePlayer.roleInfo.diamond.ToString()); Util.SetText(costCount, (int)TextForMatType.ChaseUIText, 32, str[1], canPay ? modulePlayer.roleInfo.diamond.ToString() : colorStr); sureBtn.interactable = canPay && remainCount > 0; }
public void LoadConfigInfo() { GeneralConfigInfo config = GeneralConfigInfo.Current; this.fulltextsearch.SelectedValue = config.Fulltextsearch.ToString(); this.nocacheheaders.SelectedValue = config.Nocacheheaders.ToString(); this.maxonlines.Text = config.Maxonlines.ToString(); this.searchctrl.Text = config.Searchctrl.ToString(); this.statscachelife.Text = config.Statscachelife.ToString(); this.guestcachepagetimeout.Text = config.Guestcachepagetimeout.ToString(); this.oltimespan.Text = config.Oltimespan.ToString(); this.topiccachemark.Text = config.Topiccachemark.ToString(); this.notificationreserveddays.Text = config.Notificationreserveddays.ToString(); this.maxindexsubforumcount.Text = config.Maxindexsubforumcount.ToString(); this.deletingexpireduserfrequency.Text = config.DeletingExpiredUserFrequency.ToString(); this.onlineoptimization.SelectedValue = config.Onlineoptimization.ToString(); this.avatarmethod.SelectedValue = config.AvatarStatic.ToString().ToLower(); this.showimgattachmode.SelectedValue = config.Showimgattachmode.ToString(); this.onlineusercountcacheminute.Text = config.OnlineUserCountCacheMinute.ToString(); this.posttimestoragemedia.SelectedValue = config.PostTimeStorageMedia.ToString(); this.showauthorstatusinpost.SelectedValue = ((config.Onlinetimeout >= 0) ? "2" : "1"); this.onlinetimeout.Text = (((config.Onlinetimeout > 0) ? 1 : -1) * config.Onlinetimeout).ToString(); this.jqueryurl.Text = config.Jqueryurl; this.txtImageServer.Text = config.ImageServer; this.txtJsServer.Text = config.JsServer; this.txtCssServer.Text = config.CssServer; }
protected void Page_Load(object sender, EventArgs e) { if (!checkLicense()) { ShowMessage("您的系统授权已经过期,请及时联系客服!"); return; } if (!Page.IsPostBack) { GeneralConfigInfo gi = GeneralConfigs.GetConfig(); if (gi.IsOEM) { CopyrightLiteral.Text = gi.Copyright; } else { CopyrightLiteral.Text = gi.CopyrightOfWe7; } SiteConfigInfo si = SiteConfigs.GetConfig(); if (si == null) { Response.Write("对不起,您的系统已经升级,但配置文件尚未升级,您需要对配置数据进行升级。现在升级吗?<a href='../install/upgradeconfig.aspx'><u>现在升级</u></a>"); Response.End(); } else { #if DEBUG LoginNameTextBox.Text = si.AdministratorName; #endif GenerateRandomCode(); } } }
protected override void Initialize() { string msg = @"您尚未指定当前模板组,您可以:<br>" + "(1)在下面可选模板组中,选择一个,点击”应用“;<br>" + "(2)创建一个新的模板组(上面工具条中点击”创建模板组“);<br>" + "(3)上传一个模板组包(工具条中点击”上传模板“)。"; GeneralConfigInfo si = GeneralConfigs.GetConfig(); if (si.DefaultTemplateGroupFileName != "") { List <TemplateGroup> tg = new List <TemplateGroup>(); try { tg.Add(TemplateHelper.GetTemplateGroup(si.DefaultTemplateGroupFileName)); UseTemplateGroupsDataList.DataSource = tg; UseTemplateGroupsDataList.DataBind(); } catch { UseTemplateGroupsLabel.Text = msg; } } else { UseTemplateGroupsLabel.Text = msg; } TemplateGroupsDataList.DataSource = TemplateHelper.GetTemplateGroups(null); TemplateGroupsDataList.DataBind(); //获取商城的免费模板 GetShopFreeTemplateGroup(); }
public void LoadConfigInfo() { GeneralConfigInfo config = GeneralConfigInfo.Current; this.modworkstatus.SelectedValue = config.Modworkstatus.ToString(); this.userstatusby.SelectedValue = ((config.Userstatusby.ToString() != "0") ? "1" : "0"); this.rssttl.Text = config.Rssttl.ToString(); this.losslessdel.Text = config.Losslessdel.ToString(); this.editedby.SelectedValue = config.Editedby.ToString(); this.allowswitcheditor.SelectedValue = config.Allowswitcheditor.ToString(); this.reasonpm.SelectedValue = config.Reasonpm.ToString(); this.hottopic.Text = config.Hottopic.ToString(); this.starthreshold.Text = config.Starthreshold.ToString(); this.fastpost.SelectedValue = config.Fastpost.ToString(); this.enabletag.SelectedValue = config.Enabletag ? "1" : "0"; string[] array = config.Ratevalveset.Split(','); this.ratevalveset1.Text = array[0]; this.ratevalveset2.Text = array[1]; this.ratevalveset3.Text = array[2]; this.ratevalveset4.Text = array[3]; this.ratevalveset5.Text = array[4]; this.forcewww.SelectedValue = config.Forcewww.ToString(); this.statstatus.SelectedValue = config.Statstatus.ToString().ToLower(); this.hottagcount.Text = config.Hottagcount.ToString(); this.maxmodworksmonths.Text = config.Maxmodworksmonths.ToString(); this.replynotificationstatus.SelectedValue = config.Replynotificationstatus.ToString(); this.replyemailstatus.SelectedValue = config.Replyemailstatus.ToString(); this.quickforward.SelectedValue = config.Quickforward.ToString(); this.viewnewtopicminute.Text = config.Viewnewtopicminute.ToString(); this.rssstatus.SelectedValue = config.Rssstatus.ToString(); this.msgforwardlist.Text = config.Msgforwardlist.Replace(",", "\r\n"); this.cachelog.SelectedValue = config.Cachelog.ToString(); //this.silverlight.SelectedValue = this.config.Silverlight.ToString(); }
void ApplyDefaultTemplate(string fileName) { GeneralConfigInfo si = GeneralConfigs.GetConfig(); si.DefaultTemplateGroupFileName = fileName; GeneralConfigs.SaveConfig(si); }
/// <summary> /// 按照变量生成文章URL /// </summary> /// <param name="sn"></param> /// <param name="create"></param> /// <param name="id"></param> /// <param name="modelName"></param> /// <returns></returns> public string GenerateArticleUrl(long sn, DateTime create, string id, string modelName) { GeneralConfigInfo si = GeneralConfigs.GetConfig(); string ext = si.UrlFormat; if (!String.IsNullOrEmpty(modelName)) { string snRex = si.ArticleUrlGenerator; if (snRex != null && snRex.Trim().Length > 0) { if (snRex == "0") { return(sn.ToString() + "." + ext); } else { return(create.ToString(snRex) + "-" + sn.ToString() + "." + ext); } } else { return(We7Helper.GUIDToFormatString(id) + "." + ext); } } else { return(We7Helper.GUIDToFormatString(id) + "." + ext); } }
public void LoadConfigInfo() { #region 加载配置信息 //加载验证码的显示 string[] dllFiles = System.IO.Directory.GetFiles(HttpRuntime.BinDirectory, "Discuz.Plugin.VerifyImage.*.dll"); foreach (string dllFile in dllFiles) { string filename = dllFile.ToString().Substring(dllFile.ToString().IndexOf("Discuz.Plugin.VerifyImage")).Replace("Discuz.Plugin.VerifyImage.", "").Replace(".dll", ""); VerifyImage.Items.Add(filename); } GeneralConfigInfo __configinfo = GeneralConfigs.Deserialize(Server.MapPath("../../config/general.config")); maxonlines.Text = __configinfo.Maxonlines.ToString(); postinterval.Text = __configinfo.Postinterval.ToString(); searchctrl.Text = __configinfo.Searchctrl.ToString(); maxspm.Text = __configinfo.Maxspm.ToString(); seccodestatus.AddAttributes("readonly", ""); seccodestatus.Attributes.Add("onfocus", "this.className='';"); seccodestatus.Attributes.Add("onblur", "this.className='';"); admintools.SelectedValue = __configinfo.Admintools.ToString(); VerifyImage.Items.Add(new ListItem("系统默认验证码", "")); seccodestatus.Text = __configinfo.Seccodestatus.Replace(",", "\r\n"); ViewState["Seccodestatus"] = __configinfo.Seccodestatus.ToString(); VerifyImage.SelectedValue = __configinfo.VerifyImageAssemly; try { secques.SelectedValue = __configinfo.Secques.ToString(); } catch { secques.SelectedValue = "1"; } #endregion }
/// <summary> /// 初始化 /// </summary> /// <param name="e"></param> override protected void OnInit(EventArgs e) { base.OnInit(e); GeneralConfigInfo config = GeneralConfigs.GetConfig(); string bgcolor = DNTRequest.GetQueryString("bgcolor").Trim(); int textcolor = DNTRequest.GetQueryInt("textcolor", 1); string[] bgcolorArray = bgcolor.Split(','); Color bg = Color.White; if (bgcolorArray.Length == 1 && bgcolor != string.Empty) { bg = Utils.ToColor(bgcolor); } else if (bgcolorArray.Length == 3 && Utils.IsNumericArray(bgcolorArray)) { bg = Color.FromArgb(Utils.StrToInt(bgcolorArray[0], 255), Utils.StrToInt(bgcolorArray[1], 255), Utils.StrToInt(bgcolorArray[2], 255)); } CookiesHelper.FailNoDomainCoolie("CheckCode"); OnlineUserInfo oui = OnlineUsers.UpdateInfo(config.Passwordkey, config.Onlinetimeout); string checkCode = oui.Verifycode; VerifyImageInfo verifyimg = VerifyImageProvider.GetInstance(config.VerifyImageAssemly).GenerateImage(checkCode, 120, 60, bg, textcolor); //用于验证 CookiesHelper.AddNoDomainCoolie("CheckCode", checkCode, 1); Bitmap image = verifyimg.Image; System.Web.HttpContext.Current.Response.ContentType = verifyimg.ContentType; image.Save(this.Response.OutputStream, verifyimg.ImageFormat); }
public ActionResult Index() { GeneralConfigInfo config = GeneralConfigs.GetConfig(); InitFrom(config); return(View(config)); }
public void LoadConfigInfo() { GeneralConfigInfo config = GeneralConfigInfo.Current; this.attachrefcheck.SelectedValue = config.Attachrefcheck.ToString(); this.attachsave.SelectedValue = config.Attachsave.ToString(); this.watermarktype.SelectedValue = config.Watermarktype.ToString(); this.showattachmentpath.SelectedValue = config.Showattachmentpath.ToString(); this.attachimgmaxheight.Text = config.Attachimgmaxheight.ToString(); this.attachimgmaxwidth.Text = config.Attachimgmaxwidth.ToString(); this.attachimgquality.Text = config.Attachimgquality.ToString(); this.watermarkfontsize.Text = config.Watermarkfontsize.ToString(); this.watermarktext.Text = config.Watermarktext.ToString(); this.watermarkpic.Text = config.Watermarkpic.ToString(); this.watermarktransparency.Text = config.Watermarktransparency.ToString(); this.LoadPosition(config.Watermarkstatus); this.LoadSystemFont(); try { this.watermarkfontname.SelectedValue = config.Watermarkfontname.ToString(); } catch { this.watermarkfontname.SelectedIndex = 0; } }
/// <summary> /// 设置关于showgoods页面链接的显示样式 /// </summary> /// <param name="forumid"></param> /// <param name="pageid"></param> /// <returns></returns> public static string ShowGoodsListAspxRewrite(int categoryid, int pageid) { GeneralConfigInfo config = GeneralConfigs.GetConfig(); //当使用伪aspx if (config.Aspxrewrite == 1) { if (pageid > 0) { return("showgoodslist-" + categoryid + "-" + pageid + config.Extname); } else { return("showgoodslist-" + categoryid + config.Extname); } } else { if (pageid > 0) { return("showgoodslist.aspx?categoryid=" + categoryid + "&page=" + pageid); } else { return("showgoodslist.aspx?categoryid=" + categoryid); } } }
public HelpPage() { GeneralConfigInfo config = GeneralConfigs.GetConfig(); forumtitle = config.Forumtitle; forumurl = config.Forumurl; }
/// <summary> /// 设置关于showtopic页面链接的显示样式 /// </summary> /// <param name="forumid"></param> /// <param name="pageid"></param> /// <returns></returns> public static string ShowTopicAspxRewrite(int topicid, int pageid) { GeneralConfigInfo config = GeneralConfigs.GetConfig(); //当使用伪aspx if (config.Aspxrewrite == 1) { if (pageid > 0) { return("showtopic-" + topicid + "-" + pageid + config.Extname); } else { return("showtopic-" + topicid + config.Extname); } } else { if (pageid > 0) { return("showtopic.aspx?topicid=" + topicid + "&page=" + pageid); } else { return("showtopic.aspx?topicid=" + topicid); } } }
protected void Page_Load(object sender, EventArgs e) { //BindData(); GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); list = Utils.SplitString(configInfo.Sharelist.ToString(), ","); }
public void LoadConfigInfo() { #region 加载配置信息 GeneralConfigInfo configInfo = GeneralConfigs.GetConfig(); forumtitle.Text = configInfo.Forumtitle.ToString(); webtitle.Text = configInfo.Webtitle.ToString(); weburl.Text = configInfo.Weburl.ToString(); licensed.SelectedValue = configInfo.Licensed.ToString(); icp.Text = configInfo.Icp.ToString(); debug.SelectedValue = configInfo.Debug.ToString(); Statcode.Text = configInfo.Statcode; Linktext.Text = configInfo.Linktext; spacename.Text = configInfo.Spacename.ToString(); albumname.Text = configInfo.Albumname.ToString(); closed.SelectedValue = configInfo.Closed.ToString(); closedreason.Text = configInfo.Closedreason.ToString(); EnableSpace.SelectedValue = configInfo.Enablespace.ToString(); EnableAlbum.SelectedValue = configInfo.Enablealbum.ToString(); EnableMall.SelectedValue = configInfo.Enablemall.ToString(); if (!haveSpace) { EnableSpace.Visible = false; EnableSpaceLabel.Visible = false; } if (!haveAlbum) { EnableAlbum.Visible = false; EnableAlbumLabel.Visible = false; } #endregion }
/// <summary> /// 邮件配置信息 /// </summary> /// <param name="adviceType"></param> public MailHelper GetMailHelper(AdviceType adviceType) { MailHelper mailHelper = new MailHelper(); //取得邮件服务器信息 if (adviceType.UseSystemMail == 0) { GeneralConfigInfo ci = GeneralConfigs.GetConfig(); if (ci != null) { mailHelper.SmtpServer = ci.SysMailServer; mailHelper.AdminEmail = ci.SystemMail; mailHelper.UserName = ci.SysMailUser; mailHelper.Password = ci.SysMailPassword; mailHelper.PopServer = ci.SysPopServer; } } else if (adviceType.UseSystemMail == 1) { mailHelper.SmtpServer = adviceType.MailSMTPServer; mailHelper.AdminEmail = adviceType.MailAddress; mailHelper.UserName = adviceType.MailUser; mailHelper.Password = adviceType.MailPassword; mailHelper.PopServer = adviceType.POPServer; } return(mailHelper); }
/// <summary> /// 获取配置对象实例 /// </summary> /// <returns></returns> public static GeneralConfigInfo Instance() { filenewchange = System.IO.File.GetLastWriteTime(path).ToString(); //当程序运行中general.config发生变化时则对config重新赋值 if(fileoldchange != filenewchange) { fileoldchange = filenewchange; lock (lockHelper) { config = (GeneralConfigInfo)Common.SerializationHelper.Load(typeof(GeneralConfigInfo), path); } } return config; }
/// <summary> /// 设置配置对象实例 /// </summary> /// <param name="anConfig"></param> public static void SetInstance(GeneralConfigInfo anConfig) { if (anConfig == null) return; config = anConfig; }
static ConfigProvider() { fileoldchange = System.IO.File.GetLastWriteTime(path).ToString(); config = (GeneralConfigInfo)Common.SerializationHelper.Load(typeof(GeneralConfigInfo), path); }