public M_Site GetSiteModel() { string path = this.DirName + @"\site.config"; if (!File.Exists(path)) { return null; } XmlDocument document = new XmlDocument(); document.Load(path); M_Site site = new M_Site(); XmlNode node = document.ChildNodes[1]; site.SequenceNum = node.ChildNodes[0].InnerText.Trim(); site.SiteName = node.ChildNodes[1].InnerText.Trim(); site.Domain = node.ChildNodes[2].InnerText.Trim(); site.LogoAddress = node.ChildNodes[3].InnerText.Trim(); site.BannerAddress = node.ChildNodes[4].InnerText.Trim(); site.CopyRight = node.ChildNodes[5].InnerText.Trim(); site.IsStaticType = bool.Parse(node.ChildNodes[6].InnerText.Trim()); site.IsAbsPathType = bool.Parse(node.ChildNodes[7].InnerText.Trim()); site.Keyword = node.ChildNodes[8].InnerText.Trim(); site.KeyContent = node.ChildNodes[9].InnerText.Trim(); site.IndexTemplatePath = node.ChildNodes[10].InnerText.Trim(); site.PageType = int.Parse(node.ChildNodes[11].InnerText.Trim()); site.EmailServerAddress = node.ChildNodes[12].InnerText.Trim(); site.EmailServerUserName = node.ChildNodes[13].InnerText.Trim(); site.EmailServerUserPass = node.ChildNodes[14].InnerText.Trim(); site.IsAllowRegsite = bool.Parse(node.ChildNodes[15].InnerText.Trim()); site.IsTestEmail = bool.Parse(node.ChildNodes[16].InnerText.Trim()); site.DefaultUserGroup = int.Parse(node.ChildNodes[17].InnerText); site.LogErrorNum = int.Parse(node.ChildNodes[18].InnerText.Trim()); site.IsLoginValidate = bool.Parse(node.ChildNodes[19].InnerText.Trim()); site.IsCommentValidate = bool.Parse(node.ChildNodes[20].InnerText.Trim()); site.IsAllowCommentNoName = bool.Parse(node.ChildNodes[21].InnerText.Trim()); site.IsAddCommentEditor = bool.Parse(node.ChildNodes[22].InnerText.Trim()); site.FilterStr = node.ChildNodes[23].InnerText.Trim(); site.GUnitName = node.ChildNodes[24].InnerText.Trim(); site.IsImgWaterMark = bool.Parse(node.ChildNodes[25].InnerText.Trim()); site.WaterMarkStr = node.ChildNodes[26].InnerText.Trim(); site.WaterMarkFontSize = int.Parse(node.ChildNodes[27].InnerText.Trim()); site.WaterMarkFontName = node.ChildNodes[28].InnerText.Trim(); site.WaterMarkFontColor = node.ChildNodes[29].InnerText.Trim(); site.WaterMarkIsBold = bool.Parse(node.ChildNodes[30].InnerText.Trim()); site.WaterMarkPath = node.ChildNodes[31].InnerText.Trim(); site.WaterMarkHW = node.ChildNodes[32].InnerText.Trim(); site.WaterMarkLight = int.Parse(node.ChildNodes[33].InnerText.Trim()); site.WaterMarkPos = int.Parse(node.ChildNodes[34].InnerText.Trim()); site.IsOpenRZM = bool.Parse(node.ChildNodes[35].InnerText.Trim()); site.DisabledLoginTime = int.Parse(node.ChildNodes[36].InnerText.Trim()); site.IsOpenInvite = bool.Parse(node.ChildNodes[37].InnerText.Trim()); site.GNumber = int.Parse(node.ChildNodes[38].InnerText.Trim()); site.G_Score = int.Parse(node.ChildNodes[39].InnerText.Trim()); site.G_Day = int.Parse(node.ChildNodes[40].InnerText.Trim()); site.LoginScore = int.Parse(node.ChildNodes[41].InnerText.Trim()); site.UserClassCount = int.Parse(node.ChildNodes[42].InnerText.Trim()); site.IsOpenRegLink = bool.Parse(node.ChildNodes[43].InnerText.Trim()); site.IsCheckLink = bool.Parse(node.ChildNodes[44].InnerText.Trim()); return site; }
public string LetterWaterMark(HtmlInputFile FilePicName, string FilePicPath, string UpLoadPicPath) { Font font; B_SiteInfo info = new B_SiteInfo(); M_Site siteModel = new M_Site(); siteModel = info.GetSiteModel(); string str = ""; if (UpLoadPicPath == "") { str = this.NotWaterMark_NotNewSize(FilePicName, FilePicPath); } else { str = UpLoadPicPath; } string waterMarkStr = siteModel.WaterMarkStr; int waterMarkFontSize = siteModel.WaterMarkFontSize; string waterMarkFontName = siteModel.WaterMarkFontName; string waterMarkFontColor = siteModel.WaterMarkFontColor; bool waterMarkIsBold = siteModel.WaterMarkIsBold; string path = HttpContext.Current.Server.MapPath(FilePicPath) + str; string[] strArray = str.Split(new char[] { '/' }); string[] strArray2 = strArray[1].Split(new char[] { '.' }); string destFileName = HttpContext.Current.Server.MapPath(FilePicPath) + strArray[0] + strArray2[0] + "_1" + strArray2[1]; if (File.Exists(path)) { File.Copy(path, destFileName); } Image image = Image.FromFile(destFileName); Graphics graphics = Graphics.FromImage(image); graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.DrawImage(image, 0, 0, image.Width, image.Height); if (waterMarkIsBold) { font = new Font(waterMarkFontName, (float) waterMarkFontSize, FontStyle.Bold); } else { font = new Font(waterMarkFontName, (float) waterMarkFontSize); } Brush brush = new SolidBrush(ColorTranslator.FromHtml("#" + waterMarkFontColor)); string s = waterMarkStr; graphics.DrawString(s, font, brush, (float) 0f, (float) 0f); graphics.Dispose(); image.Save(path); image.Dispose(); if (File.Exists(destFileName)) { File.Delete(destFileName); } return str; }
protected void Page_Load(object sender, EventArgs e) { hylnk.NavigateUrl = createBll.GetIndexUrl(); siteModel = siteBll.GetSiteModel(); if (!siteModel.IsOpenRegLink) { Function.ShowMsg(0, "<li>对不起,本站目前暂不接受友情链接申请.</li><li><a href='" + hylnk.NavigateUrl + "'>返回首页</a></li>"); } if (!IsPostBack) { BindData(); } }
protected void Button1_Click(object sender, EventArgs e) { string FilePath = File_PicPath.Text; string[] MyFilePath = FilePath.Split(new Char[] { '|' }); string SelectNewSize = Request.Form["NewSizeType"]; bool BiLi = false; string sMaxWidth = ""; string sMaxHeight = ""; if (SelectNewSize == "1") { BiLi = true; } if (!(NewSize.Checked)) { sMaxWidth = "100"; sMaxHeight = "100"; } else { sMaxWidth = MaxWidth.Text; sMaxHeight = MaxHeight.Text; } if (NewSize.Checked && SelectNewSize=="0") { if (!Function.CheckNumber(sMaxWidth) || !Function.CheckNumber(sMaxHeight)) { litMsg.Text = "<script language='javascript'>alert('缩略图宽度和高度只能够为数字');</script>"; return; } } if (NewSize.Checked && SelectNewSize == "1") { if (!Function.CheckNumber(BiLiValue.Text)) { litMsg.Text = "<script language='javascript'>alert('缩略图比例只能够为数字');</script>"; return; } } //获得站点域名 MSite=BSiteInfo.GetSiteModel(); string SiteUrl = MSite.Domain; string sFilePicPath = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File1, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, NewSize.Checked, int.Parse(sMaxWidth), int.Parse(sMaxHeight), BiLi, int.Parse(BiLiValue.Text),int.Parse(MyFilePath[1])); FilePicPath.Text = sFilePicPath; litMsg.Text = "<script>$('ImgPre').src='" + sFilePicPath + "';$('HrefImg').href='"+ sFilePicPath + "'</script>"; }
protected void Button1_Click(object sender, EventArgs e) { string FilePath = File_PicPath.Text; string[] MyFilePath = FilePath.Split(new Char[] { '|' }); //获得站点域名 MSite = BSiteInfo.GetSiteModel(); string SiteUrl = MSite.Domain; if (File1.Value != "") { string sFilePicPath1 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File1, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal1.Text="<script language=javascript>setImg('" + sFilePicPath1 + "');</script>"; } if (File2.Value != "") { string sFilePicPath2 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File2, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal2.Text = "<script language=javascript>setImg('" + sFilePicPath2 + "');</script>"; } if (File3.Value != "") { string sFilePicPath3 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File3, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal3.Text = "<script language=javascript>setImg('" + sFilePicPath3 + "');</script>"; } if (File4.Value != "") { string sFilePicPath4 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File4, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal4.Text = "<script language=javascript>setImg('" + sFilePicPath4 + "');</script>"; } if (File5.Value != "") { string sFilePicPath5 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File5, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal5.Text = "<script language=javascript>setImg('" + sFilePicPath5 + "');</script>"; } if (File6.Value != "") { string sFilePicPath6 = "" + SiteUrl + "/upload/" + MyFilePath[0] + "/" + up.GetUpLoadPicPath(File6, "" + Param.ApplicationRootPath + "/upload/" + MyFilePath[0] + "/", WaterMark.Checked, false, 0, 0, false, 0, int.Parse(MyFilePath[1])); Literal6.Text = "<script language=javascript>setImg('" + sFilePicPath6 + "');</script>"; } Literal7.Text = "<script language=javascript>window.close();</script>"; }
public string GetUpLoadPicPath(HtmlInputFile FilePicName, string FilePicPath, bool WaterMark, bool NewSize, int MaxWidth, int MaxHeight, bool BiLi, int BiLiValue, int FileSize) { string fileName = Path.GetFileName(FilePicName.PostedFile.FileName); string str2 = Path.GetExtension(FilePicName.PostedFile.FileName).ToString(); bool flag = false; if ((FileSize != 0) && (FilePicName.PostedFile.ContentLength > (FileSize * 0x400))) { HttpContext.Current.Response.Write("<script>alert('上传图片大小超出了限制');window.close();</script>"); HttpContext.Current.Response.End(); } B_SiteInfo info = new B_SiteInfo(); string imgUploadType = info.GetInfoModel().ImgUploadType; string[] strArray = imgUploadType.Split(new char[] { '|' }); for (int i = 0; i < strArray.Length; i++) { if (strArray[i].ToLower() == str2.ToLower()) { flag = true; break; } } if (!flag) { HttpContext.Current.Response.Write("<script>alert('上传图片格式只能够是:" + imgUploadType + "!');window.close();</script>"); HttpContext.Current.Response.End(); } M_Site siteModel = new M_Site(); siteModel = info.GetSiteModel(); if (NewSize) { return this.PicNewSize(FilePicName, FilePicPath, WaterMark, MaxWidth, MaxHeight, BiLi, BiLiValue); } if (WaterMark) { if (siteModel.IsImgWaterMark) { return this.PicWaterMark(FilePicName, FilePicPath, ""); } return this.LetterWaterMark(FilePicName, FilePicPath, ""); } return this.NotWaterMark_NotNewSize(FilePicName, FilePicPath); }
protected void Page_Load(object sender, EventArgs e) { modelId = int.Parse(Request.QueryString["modelId"].ToString()); GroupBll.Power_Judge(7); SiteModel = SiteBll.GetSiteModel(); string rpc = Page.ClientScript.GetCallbackEventReference(this, "id", "UpdateChild", "null", "ShowError", false); string func = "function ListData(id) { " + rpc + "; }"; string rpc1 = Page.ClientScript.GetCallbackEventReference(this, "id", "UpdateChild1", "null", "ShowError", false); string func1 = "function ListData1(id) {" + rpc1 + ";}"; Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ListData", func, true); Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ListData1", func1, true); if (!IsPostBack) { BindData(); BindSpeacil(); ChannelBind(); ModelBind(); } }
protected void Page_Load(object sender, EventArgs e) { Literal1.Text = ""; if (!Page.IsPostBack) { AjaxPro.Utility.RegisterTypeForAjax(typeof(user_Money_MoneyChange)); Muser=Buser.GetCookie(); LoginName.Text = Muser.LogName; // M_User Muser_1 = new M_User(); Muser_1 = Buser.GetUser(Muser.UserID); //判断过期时间 if (Muser_1.ExpireTime < DateTime.Now) { UserType.Text = "普通"; SpareDay.Text = "0天"; } else { UserType.Text = "包月"; //SpareDay.Text = Function.DateDiff(Muser_1.ExpireTime, DateTime.Now); } ExpireTime.Text = Muser_1.ExpireTime.ToString(); Money.Text = Muser_1.YellowBoy.ToString(); IntegralLable.Text = Muser_1.Integral.ToString(); //汇率 Msite=Bsiteinfo.GetSiteModel(); //积分 UserIntegral.Text = Msite.G_Score.ToString(); UserIntegral_1.Text = Msite.G_Score.ToString(); UserIntegral_2.Text = Msite.G_Score.ToString(); //金币 UserYellowBoy.Text = Msite.GNumber.ToString(); UserYellowBoy_1.Text = Msite.GNumber.ToString(); UserYellowBoy_2.Text = Msite.GNumber.ToString(); GUnitName.Text = Msite.GUnitName.ToString(); GUnitName_1.Text = Msite.GUnitName.ToString(); GUnitName_9.Text = Msite.GUnitName.ToString(); //有效期 UserExpireDay.Text = Msite.G_Day.ToString(); UserExpireDay_1.Text = Msite.G_Day.ToString(); UserExpireDay_2.Text = Msite.G_Day.ToString(); } }
public B_UserLog() { this.SiteModel = this.SiteBll.GetSiteModel(); }
public void SetSite(M_Site model) { string path = this.DirName + @"\site.config"; if (!File.Exists(path)) { XmlTextWriter writer = new XmlTextWriter(path, Encoding.UTF8); writer.Formatting = Formatting.Indented; writer.WriteStartDocument(); writer.WriteStartElement("Site"); writer.WriteElementString("SequenceNum", model.SequenceNum); writer.WriteElementString("SiteName", model.SiteName); writer.WriteElementString("Domain", model.Domain); writer.WriteElementString("LogoAddress", model.LogoAddress); writer.WriteElementString("BannerAddress", model.BannerAddress); writer.WriteElementString("CopyRight", model.CopyRight); writer.WriteElementString("IsStaticType", model.IsStaticType.ToString()); writer.WriteElementString("IsAbsPathType", model.IsAbsPathType.ToString()); writer.WriteElementString("Keyword", model.Keyword); writer.WriteElementString("KeyContent", model.KeyContent); writer.WriteElementString("IndexTemplatePath", model.IndexTemplatePath); writer.WriteElementString("PageType", model.PageType.ToString()); writer.WriteElementString("EmailServerAddress", model.EmailServerAddress); writer.WriteElementString("EmailServerUserName", model.EmailServerUserName); writer.WriteElementString("EmailServerUserPass", model.EmailServerUserPass); writer.WriteElementString("IsAllowRegsite", model.IsAllowRegsite.ToString()); writer.WriteElementString("IsTestEmail", model.IsTestEmail.ToString()); writer.WriteElementString("DefaultUserGroup", model.DefaultUserGroup.ToString()); writer.WriteElementString("LogErrorNum", model.LogErrorNum.ToString()); writer.WriteElementString("IsLoginValidate", model.IsLoginValidate.ToString()); writer.WriteElementString("IsCommentValidate", model.IsCommentValidate.ToString()); writer.WriteElementString("IsAllowCommentNoName", model.IsAllowCommentNoName.ToString()); writer.WriteElementString("IsAddCommentEditor", model.IsAddCommentEditor.ToString()); writer.WriteElementString("FilterStr", model.FilterStr); writer.WriteElementString("GUnitName", model.GUnitName); writer.WriteElementString("IsImgWaterMark", model.IsImgWaterMark.ToString()); writer.WriteElementString("WaterMarkStr", model.WaterMarkStr); writer.WriteElementString("WaterMarkFontSize", model.WaterMarkFontSize.ToString()); writer.WriteElementString("WaterMarkFontName", model.WaterMarkFontName); writer.WriteElementString("WaterMarkFontColor", model.WaterMarkFontColor); writer.WriteElementString("WaterMarkIsBold", model.WaterMarkIsBold.ToString()); writer.WriteElementString("WaterMarkPath", model.WaterMarkPath); writer.WriteElementString("WaterMarkHW", model.WaterMarkHW.ToString()); writer.WriteElementString("WaterMarkLight", model.WaterMarkLight.ToString()); writer.WriteElementString("WaterMarkPos", model.WaterMarkPos.ToString()); writer.WriteElementString("IsOpenRZM", model.IsOpenRZM.ToString()); writer.WriteElementString("DisabledLoginTime", model.DisabledLoginTime.ToString()); writer.WriteElementString("IsOpenInvite", model.IsOpenInvite.ToString()); writer.WriteElementString("G_GNumber", model.GNumber.ToString()); writer.WriteElementString("G_Score", model.G_Score.ToString()); writer.WriteElementString("G_Day", model.G_Day.ToString()); writer.WriteElementString("LoginScore", model.LoginScore.ToString()); writer.WriteElementString("UserClassCount", model.UserClassCount.ToString()); writer.WriteElementString("IsOpenRegLink", model.IsOpenRegLink.ToString()); writer.WriteElementString("IsCheckLink", model.IsCheckLink.ToString()); writer.WriteEndElement(); writer.WriteEndDocument(); writer.Flush(); writer.Close(); } else { XmlDocument document = new XmlDocument(); document.Load(path); XmlNode node = document.ChildNodes[1]; node.ChildNodes[0].InnerText = model.SequenceNum; node.ChildNodes[1].InnerText = model.SiteName; node.ChildNodes[2].InnerText = model.Domain; node.ChildNodes[3].InnerText = model.LogoAddress; node.ChildNodes[4].InnerText = model.BannerAddress; node.ChildNodes[5].InnerText = model.CopyRight; node.ChildNodes[6].InnerText = model.IsStaticType.ToString(); node.ChildNodes[7].InnerText = model.IsAbsPathType.ToString(); node.ChildNodes[8].InnerText = model.Keyword; node.ChildNodes[9].InnerText = model.KeyContent; node.ChildNodes[10].InnerText = model.IndexTemplatePath; node.ChildNodes[11].InnerText = model.PageType.ToString(); node.ChildNodes[12].InnerText = model.EmailServerAddress; node.ChildNodes[13].InnerText = model.EmailServerUserName; node.ChildNodes[14].InnerText = model.EmailServerUserPass; node.ChildNodes[15].InnerText = model.IsAllowRegsite.ToString(); node.ChildNodes[16].InnerText = model.IsTestEmail.ToString(); node.ChildNodes[17].InnerText = model.DefaultUserGroup.ToString(); node.ChildNodes[18].InnerText = model.LogErrorNum.ToString(); node.ChildNodes[19].InnerText = model.IsLoginValidate.ToString(); node.ChildNodes[20].InnerText = model.IsCommentValidate.ToString(); node.ChildNodes[21].InnerText = model.IsAllowCommentNoName.ToString(); node.ChildNodes[22].InnerText = model.IsAddCommentEditor.ToString(); node.ChildNodes[23].InnerText = model.FilterStr; node.ChildNodes[24].InnerText = model.GUnitName; node.ChildNodes[25].InnerText = model.IsImgWaterMark.ToString(); node.ChildNodes[26].InnerText = model.WaterMarkStr; node.ChildNodes[27].InnerText = model.WaterMarkFontSize.ToString(); node.ChildNodes[28].InnerText = model.WaterMarkFontName; node.ChildNodes[29].InnerText = model.WaterMarkFontColor; node.ChildNodes[30].InnerText = model.WaterMarkIsBold.ToString(); node.ChildNodes[31].InnerText = model.WaterMarkPath; node.ChildNodes[32].InnerText = model.WaterMarkHW.ToString(); node.ChildNodes[33].InnerText = model.WaterMarkLight.ToString(); node.ChildNodes[34].InnerText = model.WaterMarkPos.ToString(); node.ChildNodes[35].InnerText = model.IsOpenRZM.ToString(); node.ChildNodes[36].InnerText = model.DisabledLoginTime.ToString(); node.ChildNodes[37].InnerText = model.IsOpenInvite.ToString(); node.ChildNodes[38].InnerText = model.GNumber.ToString(); node.ChildNodes[39].InnerText = model.G_Score.ToString(); node.ChildNodes[40].InnerText = model.G_Day.ToString(); node.ChildNodes[41].InnerText = model.LoginScore.ToString(); node.ChildNodes[42].InnerText = model.UserClassCount.ToString(); node.ChildNodes[43].InnerText = model.IsOpenRegLink.ToString(); node.ChildNodes[44].InnerText = model.IsCheckLink.ToString(); document.Save(path); } }
protected void Page_Load(object sender, EventArgs e) { GroupBll.Power_Judge(7); Response.Cache.SetNoStore(); Response.Buffer = false; SiteModel = SiteBll.GetSiteModel(); string htmlstr = "<html><head><link rel='stylesheet' href='../css/default.css' type='text/css' /></head><body>\r\n<br/><br/>\r\n<div align='center'><div style='width:500px;border:solid 1px gray;height:24px' align='left'><img id='tp' height='22px' src='../images/loading.gif' width='0px'></div>\r\n</div></div>\r\n<table width='500px' align='center'><tr><td align='center' width='250px'><span id='tn'>0%</span></td><td align='center' width='250px' id='finallytd'>共<span id='total'>0</span>条</td></tr></table><script>\r\nfunction SetPr(val,curr){ \r\n document.getElementById('tp').style.width = val;document.getElementById('tn').innerText=val; \r\n}\r\nfunction SetTotal(val){ document.getElementById('total').innerText=val;}</script>\r\n</body>\r\n"; Response.Write(htmlstr); Response.Flush(); if (!string.IsNullOrEmpty(Request.QueryString["Type"])) { type = Request.QueryString["Type"].ToLower(); if(Request.QueryString["modelId"]!=null) modelId = int.Parse(Request.QueryString["modelId"].ToString()); } switch (type) { case "index": CreateIndex(); break; //生成全站首页 case "channel": CreateChannel(); break; //生成频道页 case "column": CreateColumn(); break; //生成栏目页 case "infoall": CreateInfo(modelId); break; //生成指定模型的所有数据 case "info": CreateInfoByIdStr(modelId); break; //内容列表处生成静态 case "infoid": CreateInfoId(modelId); break; //将指定Id范围内的内容生成静态 case "lastinfocount": CreateLastInfoRecord(modelId); break; //生成最新多少条记录 case "infodate": CreateInfoDate(modelId); break; //生成指定日期范围内的记录 case "infocolumn": CreateInfoColumn(modelId); break; //生成指定栏目下的内容 case "columnall": CreateColumnAll(); break; case "special": CreateSpecial(); break; } string browserIndex = string.Empty; if (type == "index") browserIndex = "<td><a href=\""+CreateBll.GetIndexUrl()+"\" target='_blank'>浏览首页</a></td>"; Response.Write("<table align='center' width='500px'><tr><td align='left'><a href='CreateNews.aspx?modelId="+modelId+"'>继续生成</a></td>" + browserIndex + "<td align='right'><a href='javascript:history.back()'>返回上一页</a></td></tr></table>"); Response.Flush(); }
protected void Page_Load(object sender, EventArgs e) { AdminBll.CheckMulitLogin(); AdminModel = AdminBll.GetLoginModel(); AdminUserModel = AdminBll.GetModel(AdminModel.UserId); litMsg.Text = ""; SiteModel = SiteBll.GetSiteModel(); InfoSiteModel = SiteBll.GetInfoModel(); if (SiteModel == null) { Function.ShowSysMsg(0, "<li>全站参数获取错误</li>"); } txtTemplatePath.Attributes.Add("readonly", ""); txtUpdateDateTime.Attributes.Add("readonly", ""); txtHeaderColor.Attributes.Add("readonly", ""); txtViewer.Attributes.Add("readonly", ""); HistoryTime = InfoSiteModel.HistoryTime; if (!string.IsNullOrEmpty(Request.QueryString["ChId"])) { try { ChannelId = int.Parse(Request.QueryString["ChId"]); } catch { } } if (!ColumnBll.ChkHasColumnByChId(ChannelId)) { Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>"); } ChannelModel = ChannelId <= 0 ? null : ChannelBll.GetChannel(ChannelId); if (ChannelModel == null || ChannelModel.ModelType != 1) { Function.ShowSysMsg(0, "<li>频道参数错误</li>"); } //保存路径 InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType); FilePicPath.Text = InfoModel.UploadPath + "|" + InfoModel.UploadSize.ToString(); if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) { try { ColumnId = int.Parse(Request.QueryString["ColId"]); } catch { } } ColumnModel = ColumnId <= 0 ? null : ColumnBll.GetColumn(ColumnId); if (ColumnId > 0 && ColumnModel == null) { Function.ShowSysMsg(0, "<li>所选栏目不存在或已经被删除</li>"); } if (Request.QueryString["Id"] != null && Request.QueryString["Id"] != "") { try { ArticleId = int.Parse(Request.QueryString["Id"]); } catch { } } if (ArticleId > 0 && !AdminGroupBll.Power_Channel(ChannelId, ColumnId, AdminUserModel.GroupId, 3)) { Function.ShowSysMsg(0, "<li>你没有该栏目下的修改权限</li>"); } if (!IsPostBack) { txtUpdateDateTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); if (HistoryTime == 0) { txtExpireTime.Text = "9999-01-01"; } else { txtExpireTime.Text = DateTime.Now.AddDays(HistoryTime).ToString("yyyy-MM-dd"); } for (int i = 0; i <= 20; i++) { ddlHeaderSize.Items.Add(new ListItem(i + "px", i + "px")); ddlHeaderSize.SelectedValue = "12px"; } if (ArticleId > 0) litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 修改" + ChannelModel.TypeName; else litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 添加" + ChannelModel.TypeName; BindSpeacil(); BindGroup(); if (ArticleId > 0) { ShowInfo(ArticleId); } } }
protected void Page_Load(object sender, EventArgs e) { AdminBll.CheckMulitLogin(); AdminModel = AdminBll.GetLoginModel(); litMsg.Text = ""; SiteModel = SiteBll.GetSiteModel(); if(SiteModel==null) { Function.ShowSysMsg(0, "<li>全站参数获取错误</li>"); } txtSoftTemplatePath.Attributes.Add("readonly", ""); txtTitleImgPath.Attributes.Add("readonly",""); if(!string.IsNullOrEmpty(Request.QueryString["ChId"])) { ChannelId = int.Parse(Request.QueryString["ChId"]); } if(!ColumnBll.ChkHasColumnByChId(ChannelId)) { Function.ShowSysMsg(0, "<li>本频道下没有栏目,不能添加信息</li><li>建议您先添加栏目</li><li><a href='info/SetColumn.aspx?ChId=" + ChannelId + "'>添加栏目</a> <a href='info/ColumnList.aspx?ChId=" + ChannelId + "'>栏目管理</a></li>"); } ChannelModel = ChannelBll.GetChannel(ChannelId); if(ChannelId<=0 || ChannelModel==null || ChannelModel.ModelType!=3) { Function.ShowSysMsg(0, "<li>频道参数错误</li>"); } if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) { ColumnId = int.Parse(Request.QueryString["ColId"]); } if (ColumnId != 0 && ColumnBll.GetColumn(ColumnId) == null) { Function.ShowSysMsg(0, "<li>所选栏目不存在或已经被删除</li>"); } if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { Id = int.Parse(Request.QueryString["Id"]); } catch{} } B_InfoModel infoModelBll=new B_InfoModel(); M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType); FilePicPath.Text = infoModel.UploadPath+"|"+infoModel.UploadSize.ToString(); if(Id>0) litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 修改" + ChannelModel.TypeName; else litNav.Text = "<a href='ColumnList.aspx?Chid=" + ChannelId + "'>" + ChannelModel.ChName + "</a> >> 添加" + ChannelModel.TypeName; if (!IsPostBack) { BindGroup(); BindDownServerType(); BindSpeacil(); if (Id > 0) ShowDownLoadInfo(Id); ddlBind(); } }
public string PicWaterMark(HtmlInputFile FilePicName, string FilePicPath, string UpLoadPicPath) { B_SiteInfo info = new B_SiteInfo(); M_Site siteModel = new M_Site(); siteModel = info.GetSiteModel(); string[] strArray = siteModel.WaterMarkHW.Split(new char[] { '|' }); string path = Param.ApplicationRootPath + siteModel.WaterMarkPath; int srcHeight = int.Parse(strArray[0]); int srcWidth = int.Parse(strArray[1]); int waterMarkLight = siteModel.WaterMarkLight; int waterMarkPos = siteModel.WaterMarkPos; string str2 = ""; if (UpLoadPicPath == "") { str2 = this.NotWaterMark_NotNewSize(FilePicName, FilePicPath); } else { str2 = UpLoadPicPath; } string str3 = HttpContext.Current.Server.MapPath(FilePicPath) + str2; string[] strArray2 = str2.Split(new char[] { '/' }); string[] strArray3 = strArray2[1].Split(new char[] { '.' }); string destFileName = HttpContext.Current.Server.MapPath(FilePicPath) + strArray2[0] + strArray3[0] + "_1" + strArray3[1]; if (File.Exists(str3)) { File.Copy(str3, destFileName); } Image image = Image.FromFile(destFileName); Image image2 = Image.FromFile(HttpContext.Current.Server.MapPath(path)); float[][] numArray = new float[5][]; float[] numArray2 = new float[5]; numArray2[0] = 1f; numArray[0] = numArray2; float[] numArray3 = new float[5]; numArray3[1] = 1f; numArray[1] = numArray3; float[] numArray4 = new float[5]; numArray4[2] = 1f; numArray[2] = numArray4; float[] numArray5 = new float[5]; numArray5[3] = ((float) waterMarkLight) / 100f; numArray[3] = numArray5; float[] numArray6 = new float[5]; numArray6[4] = 1f; numArray[4] = numArray6; float[][] newColorMatrix = numArray; ColorMatrix matrix = new ColorMatrix(newColorMatrix); ImageAttributes imageAttr = new ImageAttributes(); imageAttr.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); Graphics graphics = Graphics.FromImage(image); switch (waterMarkPos) { case 1: graphics.DrawImage(image2, new Rectangle(0, 0, srcWidth, srcHeight), 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel, imageAttr); break; case 2: graphics.DrawImage(image2, new Rectangle(image.Width - srcWidth, 0, srcWidth, srcHeight), 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel, imageAttr); break; case 3: graphics.DrawImage(image2, new Rectangle(image.Width - srcWidth, image.Height - srcHeight, srcWidth, srcHeight), 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel, imageAttr); break; case 4: graphics.DrawImage(image2, new Rectangle(0, image.Height - srcHeight, srcWidth, srcHeight), 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel, imageAttr); break; } graphics.Dispose(); image.Save(str3); image.Dispose(); if (File.Exists(destFileName)) { File.Delete(destFileName); } return str2; }
public string PicNewSize(HtmlInputFile FilePicName, string FilePicPath, bool WaterMark, int MaxWidth, int MaxHeight, bool BiLi, int BiLiValue) { Size size; string upLoadPicPath = this.NotWaterMark_NotNewSize(FilePicName, FilePicPath); string path = HttpContext.Current.Server.MapPath(FilePicPath) + upLoadPicPath; string[] strArray = upLoadPicPath.Split(new char[] { '/' }); string[] strArray2 = strArray[1].Split(new char[] { '.' }); string destFileName = HttpContext.Current.Server.MapPath(FilePicPath) + strArray[0] + strArray2[0] + "_1" + strArray2[1]; if (File.Exists(path)) { File.Copy(path, destFileName); } Image image = Image.FromFile(destFileName); if (BiLi) { size = NewSize((image.Width * BiLiValue) / 100, (image.Height * BiLiValue) / 100, image.Width, image.Height); } else { size = NewSize(MaxWidth, MaxHeight, image.Width, image.Height); } Bitmap bitmap = new Bitmap(size.Width, size.Height); Graphics graphics = Graphics.FromImage(bitmap); graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.DrawImage(image, new Rectangle(0, 0, size.Width, size.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel); graphics.Dispose(); bitmap.Save(path); bitmap.Dispose(); image.Dispose(); if (File.Exists(destFileName)) { File.Delete(destFileName); } B_SiteInfo info = new B_SiteInfo(); M_Site siteModel = new M_Site(); siteModel = info.GetSiteModel(); if (!WaterMark) { return upLoadPicPath; } if (siteModel.IsImgWaterMark) { return this.PicWaterMark(FilePicName, FilePicPath, upLoadPicPath); } return this.LetterWaterMark(FilePicName, FilePicPath, upLoadPicPath); }
protected void Page_Load(object sender, EventArgs e) { siteModel = site.GetSiteModel(); IndexUrl = getIndexBll.GetIndexUrl(); hylnkIndex.NavigateUrl = IndexUrl; if (siteModel != null && siteModel.IsAllowRegsite == false) { Function.ShowMsg(0,"<li>对不起,本站暂时关闭了新用户注册.</li><li><a href='"+IndexUrl+"'>返回首页</a></li><li><a href='javascript:window.history.back()'>返回上一步</a></li>"); } AjaxPro.Utility.RegisterTypeForAjax(typeof(user_Reg)); if (!string.IsNullOrEmpty(Request.QueryString["returnurl"])) { returnUrl = Request.QueryString["returnurl"]; } if (!string.IsNullOrEmpty(Request.QueryString["TypeId"])) { OnNull.Visible = false; try { TypeId = int.Parse(Request.QueryString["TypeId"]); } catch { } } else { if (returnUrl != string.Empty) { returnUrl1 = "&returnurl=" + Function.Encode(returnUrl); } rptGroup.DataSource = BUserGroupModel.GetAll(); rptGroup.DataBind(); OnCommon.Visible = false; } dtIsUser = BUserGroupModelField.GetIsUserList(TypeId); MUserGroupModel = BUserGroupModel.GetModel(TypeId); if (!Page.IsPostBack) { if (MUserGroupModel != null) { ModelHtml.Text = MUserGroupModel.ModelHtml; //判断该用户组模型是否设置了用户组 if (MUserGroupModel.UserGroupId == 0) { Function.ShowMsg(0, "<li>对不起,该会员类型还未指定用户组,目前无法注册</li><li><a href='javascript:window.history.back()'>返回上一步</a></li>"); } if (MUserGroupModel.IsValidate) { Code.Visible = true; } else { Code.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //登陆 MUser = BUser.GetCookie(); //系统公告 rptNotice.DataSource = BNotice.GetTop(5); rptNotice.DataBind(); M_User UserModel = new M_User(); UserModel = BUser.GetUser(MUser.UserID); int UserId = UserModel.UserID; int GroupId = UserModel.GroupID; MUserGroup = BUserGroup.GetModel(GroupId); MyProfile ="SetUser.aspx"; //系统参数 MSite = BSiteInfo.GetSiteModel(); int publishInfoSumCount = 0; int waitInfoSumCount = 0; DataTable dtInfo = new DataTable(); dtInfo.Columns.Add("RowIndex", typeof(int)); dtInfo.Columns.Add("Title", typeof(string)); dtInfo.Columns.Add("Id", typeof(int)); dtInfo.Columns.Add("AddTime", typeof(DateTime)); DataTable modelDt = InfoModelBll.GetList(); int rowIndex = 0; foreach (DataRow dr in modelDt.Rows) { int publishInfoCount = 0; int waitInfoCount = 0; string tableName = dr["TableName"].ToString(); DataTable dt = InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "-2,0,1,2,3", "", "", "", -1, 1, 5, ref publishInfoCount); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr2 = dt.Rows[i]; DataRow tempdr2 = dtInfo.NewRow(); tempdr2["RowIndex"] = rowIndex; rowIndex++; tempdr2["Title"] = dr2["Title"]; tempdr2["Id"] = dr2["Id"]; tempdr2["AddTime"] = dr2["AddTime"]; dtInfo.Rows.Add(tempdr2); } dt.Dispose(); publishInfoSumCount += publishInfoCount; dt = InfoOperBll.GetUserInfoList(tableName, UserId, "", "", 0, "0", "0", "", "", "", -1, 1, 0, ref waitInfoCount); dt.Dispose(); waitInfoSumCount += waitInfoCount; } DataView dv = new DataView(dtInfo); dv.Sort = "AddTime Desc"; dv.RowFilter = "RowIndex<5"; Repeater2.DataSource = dv; Repeater2.DataBind(); dv.Dispose(); //好友 int total = 0; Repeater4.DataSource = BUser.ListGroupMember("KyUserFriend.UserId=" + UserId + " and FriendGroupId!=2", 5, 1, ref total); Repeater4.DataBind(); DataTable cdt = new DataTable(); cdt = BCustomForm.GetAll(); cdt.DefaultView.RowFilter = "ShowForm=1"; Rep_CustomForm.DataSource = cdt; Rep_CustomForm.DataBind(); cdt.Clear(); cdt.Dispose(); //留言 int recordCount = 0; DataTable mdt = UserMessageBll.GetMessageByUserId(UserModel.UserID, 1, 100000, ref recordCount); rptMsg.DataSource = mdt; rptMsg.DataBind(); //投稿 SetUserInfoNav(); } }
protected void Button1_Click(object sender, EventArgs e) { string MyChangeValue = ChangeValue.Text; string MyMoneyType = MoneyType.SelectedValue; string MySendUser = SendUser.Text; string MyMoneyType_1 = MoneyType.SelectedItem.Text; string MyGUnitName = ""; //汇率 Msite = Bsiteinfo.GetSiteModel(); if (MyMoneyType == "1") { MyGUnitName = Msite.GUnitName.ToString(); } if (MyMoneyType == "2") { MyGUnitName = "点"; } if (MyMoneyType == "3") { MyGUnitName = "天"; } string MyPassWord = PassWord.Text; // Muser = Buser.GetCookie(); M_User Muser_1 = new M_User(); int UserId = Muser.UserID; Muser_1 = Buser.GetUser(UserId); #region 验证判断 if (!Function.CheckNumberNotZero(MyChangeValue)) { Function.ShowMsg(0, "<li>请输入一个大于0的整数</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } if (MyMoneyType == "0") { Function.ShowMsg(0, "<li>请选择转换栏目</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } if (MySendUser == "0") { Function.ShowMsg(0, "<li>请输入赠送用户名称</li><li><a href='Money/MoneySend.aspx>返回上一步</a></li>"); } if (MyPassWord == "" || MyPassWord == null) { Function.ShowMsg(0, "<li>请输入登陆密码</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } if (Muser_1.UserPwd != Function.MD5Encrypt(MyPassWord)) { Function.ShowMsg(0, "<li>登陆密码输入错误</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } #endregion #region 判断用户输入赠送用户的合法性 B_Money BMoney = new B_Money(); if (Buser.GetUser(MySendUser) == null) { Function.ShowMsg(0, "<li>赠送的用户不存在</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } else { int SendUserId=Buser.GetUser(MySendUser).UserID; if (MyMoneyType == "1") { if (Muser_1.YellowBoy < int.Parse(MyChangeValue)) { Function.ShowMsg(0, "<li>金币不足,请重新输入</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } else { BMoney.YellowBoy(decimal.Parse(MyChangeValue), SendUserId); BMoney.YellowBoy(-decimal.Parse(MyChangeValue), UserId); } } if (MyMoneyType == "2") { if (Muser_1.Integral < int.Parse(MyChangeValue)) { Function.ShowMsg(0, "<li>积分不足,请重新输入</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } else { BMoney.Integral(int.Parse(MyChangeValue), SendUserId); BMoney.Integral(-int.Parse(MyChangeValue), UserId); } } if (MyMoneyType == "3") { TimeSpan ts1 = new TimeSpan(Muser_1.ExpireTime.Ticks); TimeSpan ts2 = new TimeSpan(DateTime.Now.Ticks); if (ts1.Subtract(ts2).Days < int.Parse(MyChangeValue)) { Function.ShowMsg(0, "<li>有效期天数不足,请重新输入</li><li><a href='Money/MoneySend.aspx'>返回上一步</a></li>"); } else { BMoney.ExpireTime(int.Parse(MyChangeValue), SendUserId); BMoney.ExpireTime(-int.Parse(MyChangeValue), UserId); } } } #endregion //记录日志 B_UserLog logBll = new B_UserLog(); M_UserLog logModel = new M_UserLog(); logModel.AddTime = DateTime.Now; logModel.Description = "成功赠送给[" + MySendUser + "]" + MyChangeValue + "" + MyGUnitName + "" + MyMoneyType_1; logModel.InfoId = 0; logModel.ModelType = 0; logModel.Point = 0; logModel.UserId = Muser_1.UserID; logModel.UserName = Muser_1.LogName; logBll.Add(logModel); Function.ShowMsg(1, "<li>成功赠送给[" + MySendUser + "]" + MyChangeValue + "" + MyGUnitName + "" + MyMoneyType_1 + "</li><li><a href='Money/MoneySend.aspx'>返回财富赠送</a></li>"); }
protected void Page_Load(object sender, EventArgs e) { AdminBll.CheckMulitLogin(); M_LoginAdmin loginAdminModel = AdminBll.GetLoginModel(); AdminModel = AdminBll.GetModel(loginAdminModel.UserId); SiteModel = SiteBll.GetSiteModel(); #region 频道,模型,栏目参数检验 if (!string.IsNullOrEmpty(Request.QueryString["ChId"])) { try { ChId = int.Parse(Request.QueryString["ChId"]); } catch { } } ChannelModel = ChannelBll.GetChannel(ChId); if (ChannelModel == null) { Function.ShowSysMsg(0, "<li>所属频道不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>"); } InfoModel = InfoModelBll.GetModel(ChannelModel.ModelType); if (InfoModel == null) { Function.ShowSysMsg(0, "<li>所属模型不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>"); } if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) { try { ColumnId = int.Parse(Request.QueryString["ColId"]); } catch { } } ColumnModel = ColumnBll.GetColumn(ColumnId); if (ColumnId != 0 && ColumnModel == null) { Function.ShowSysMsg(0, "<li>所属栏目不存在或已经被删除</li><li><a href='javascript:window.history.back(-1)'>返回上一步</a></li>"); } #endregion SetNav(); AuditingLevel = PowerGroupBll.Power_Auditing(ChId, AdminModel.GroupId); SetBtnStatus(); #region 获取搜索字段 if (!string.IsNullOrEmpty(Request.QueryString["FieldName"])) { FieldName = Request.QueryString["FieldName"]; } if (!string.IsNullOrEmpty(Request.QueryString["Keyword"])) { Keyword = Request.QueryString["Keyword"].Trim(); if (!IsPostBack) { txtKeyword.Text = Keyword; } } #endregion #region 设置审核参数 if (!string.IsNullOrEmpty(Request.QueryString["Status"])) { string status = Request.QueryString["Status"].ToLower(); if (status == "no") { switch (AuditingLevel) { default: Status = "-99"; break; case "1": Status = "0"; break; case "2": Status = "0,1"; break; case "3": Status = "0,1,2"; break; } } else { Status = "3"; } } #endregion #region 设置投稿参数 if (!string.IsNullOrEmpty(Request.QueryString["UserType"])) { try { UserType = int.Parse(Request.QueryString["UserType"]); } catch { } } #endregion if (!IsPostBack) { InitProperty(); BindColumn(); BindChannel(); Bind(); ddlsortName.Items[0].Text = ChannelModel.TypeName + "标题"; if (gvInfoList.Rows.Count > 0) gvInfoList.HeaderRow.Cells[1].Text = ChannelModel.TypeName + "标题"; } }
public B_Create() { this.SiteModel = this.SiteBll.GetSiteModel(); this.InfoSiteModel = this.SiteBll.GetInfoModel(); if (this.SiteModel.IsAbsPathType) { this.HostAddress = this.SiteModel.Domain; } else { this.HostAddress = Param.ApplicationRootPath; } }
private string GetContent(M_Collection collectionM, string contentStr) { this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId); this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId); this.ModelM = this.InfoModelBll.GetModel(this.ChannelM.ModelType); this.SiteModel = this.SiteBll.GetSiteModel(); B_ConvertImage image = new B_ConvertImage(this.SiteModel.Domain, this.ModelM.UploadPath); string simpleFilterRule = collectionM.SimpleFilterRule; string pattern = string.Empty; string complexityFilterRule = collectionM.ComplexityFilterRule; if (complexityFilterRule != "") { string[] strArray = complexityFilterRule.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { this.SuperiorM = this.SuperiorBll.GetIdBySuperior(int.Parse(strArray[i].ToString())); pattern = this.TransferStr(this.SuperiorM.StartCode) + "((?:.|\n)*?)" + this.TransferStr(this.SuperiorM.EndCode); contentStr = this.SuperiorHtml(contentStr, pattern); } } if (simpleFilterRule != "") { string[] strArray2 = simpleFilterRule.Split(new char[] { ',' }); for (int j = 0; j < (strArray2.Length - 1); j++) { switch (int.Parse(strArray2[j].ToString())) { case 0: contentStr = this.FilterObject(contentStr); break; case 1: contentStr = this.FilterScript(contentStr); break; case 2: contentStr = this.FilterStyle(contentStr); break; case 3: contentStr = this.FilterDiv(contentStr); break; case 4: contentStr = this.FilterSpan(contentStr); break; case 5: contentStr = this.FilterTableProtery(contentStr); break; case 6: contentStr = this.FilterImg(contentStr); break; case 7: contentStr = this.FilterFont(contentStr); break; case 8: contentStr = this.FilterA(contentStr); break; case 9: contentStr = this.RemoveHtml(contentStr); break; } } } contentStr = image.ConvertLocalImagePath(contentStr); contentStr = image.ConvertContent(contentStr); return contentStr; }
protected void Page_Load(object sender, EventArgs e) { litMsg.Text = ""; UserBll.CheckIsLogin(); UserModel = UserBll.GetUser(UserBll.GetCookie().LogName); UserGroupModel = UserGroupBll.GetModel(UserModel.GroupID); SiteModel = SiteBll.GetSiteModel(); if (SiteModel == null) Function.ShowMsg(0, "<li>全站参数获取错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!string.IsNullOrEmpty(Request.QueryString["Id"])) { try { Id = Convert.ToInt32(Request.QueryString["Id"]); } catch { } } if (!string.IsNullOrEmpty(Request.QueryString["ChId"])) { ChId = int.Parse(Request.QueryString["ChId"]); } ChannelModel = ChId <= 0 ? null : ChannelBll.GetChannel(ChId); if (ChannelModel == null || ChId < 0) Function.ShowMsg(0, "<li>频道参数错误</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!UserGroupBll.Power_ColumnPower(ChId, 0, UserGroupModel.ColumnPower, 3)) Function.ShowMsg(0, "<li>本频道没有添加" + ChannelModel.TypeName + "的权限</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!ColumnBll.ChkHasColumnByChId(ChId)) Function.ShowMsg(0, "<li>本频道下没有栏目,不能添加" + ChannelModel.TypeName + "</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); if (!string.IsNullOrEmpty(Request.QueryString["ColId"])) ColId = Convert.ToInt32(Request.QueryString["ColId"]); ColumnModel = ColId <= 0 ? null : ColumnBll.GetColumn(ColId); if (ColId > 0 && ColumnModel == null) Function.ShowMsg(0, "<li>所选栏目不存在或已经被删除</li><li><a href='javascript:history.back()'>返回上一级</a></li>"); B_InfoModel infoModelBll = new B_InfoModel(); M_InfoModel infoModel = infoModelBll.GetModel(ChannelModel.ModelType); FilePicPath.Text = infoModel.UploadPath + "|" + infoModel.UploadSize.ToString(); if (!IsPostBack) { UserCateBound(); ddlBind(); if (Id > 0) ShowInfo(Id); } }
protected void btnSumbit_Click(object sender, EventArgs e) { if(txtSequenceNum.Text.Trim().Length==0) { Function.ShowSysMsg(0, "<li>产品序列号必须填写</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } if (txtDomain.Text.Trim().Length == 0) { Function.ShowSysMsg(0, "<li>站点域名必须填写</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } if(txtIndexTemplatePath.Text.Trim().Length==0) { Function.ShowSysMsg(0, "<li>首页模版必须选择</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } if(chkBoxIsTestEmail.Checked&&(txtEmailServerAddress.Text.Trim().Length==0||txtServerUserName.Text.Trim().Length==0||(txtServerUserPass.Text.Trim().Length==0&&litUserPass.Text.Length==0))) { Function.ShowSysMsg(0, "<li>选择了注册时邮箱验证,邮件发送设置必须填写</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } if(chkBoxIsTestEmail.Checked) { if(!Regex.IsMatch(txtServerUserName.Text.Trim(),@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*",RegexOptions.IgnoreCase)) { Function.ShowSysMsg(0, "<li>发送邮件的地址名称格式不正确</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } } if (txtFilterStr.Text.Length > 1000) { Function.ShowSysMsg(0, "<li>过滤关键字不能超过1000个字</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } if(txtGUnitName.Text.Trim().Length==0) { Function.ShowSysMsg(0, "<li>金币单位必须填写</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); } M_Site siteModel = new M_Site(); M_InfoSite infoModel = new M_InfoSite(); siteModel.SiteName = txtSiteName.Text; siteModel.Domain = txtDomain.Text; siteModel.LogoAddress = txtLogoAddress.Text; siteModel.BannerAddress = txtBannerAddress.Text; siteModel.Keyword = txtKeyword.Text; siteModel.KeyContent = txtKeyContent.Text; siteModel.SequenceNum = txtSequenceNum.Text; if (Request.Form["txtIndexTemplatePath"] != null && Request.Form["txtIndexTemplatePath"] != "") { siteModel.IndexTemplatePath = Request.Form["txtIndexTemplatePath"]; } if (rdPageType1.Checked) { siteModel.PageType = 1; } else if (rdPageType2.Checked) { siteModel.PageType = 2; } else if (rdPageType3.Checked) { siteModel.PageType = 3; } else if (rdPageType4.Checked) { siteModel.PageType = 4; } siteModel.IsStaticType = chkBoxIsStaticType.Checked; if (rdIsAbsPathType2.Checked) { siteModel.IsAbsPathType = true; } else { siteModel.IsAbsPathType = false; } siteModel.CopyRight = txtCopyRight.Text; siteModel.DefaultUserGroup = 0; siteModel.IsAllowRegsite = chkBoxAllowRegiste.Checked; siteModel.IsTestEmail = chkBoxIsTestEmail.Checked; siteModel.IsLoginValidate = chkBoxIsLoginValidate.Checked; siteModel.IsCommentValidate = chkBoxIsCommentValidate.Checked; siteModel.IsAllowCommentNoName = chkBoxIsAllowCommentNoName.Checked; siteModel.IsAddCommentEditor = chkBoxIsAddCommentEditor.Checked; siteModel.FilterStr = txtFilterStr.Text; siteModel.GUnitName = txtGUnitName.Text; try { siteModel.LogErrorNum = int.Parse(txtLoginErrorNum.Text); } catch { siteModel.LogErrorNum = 0; } siteModel.IsOpenInvite = chkBoxIsOpenInvite.Checked; try { siteModel.GNumber = int.Parse(txtGNumber.Text.Trim()); } catch { siteModel.GNumber = 0; } try { siteModel.G_Day = int.Parse(txtG_Day.Text); } catch { siteModel.G_Day = 0; } try { siteModel.G_Score = int.Parse(txtG_Score.Text); } catch { siteModel.G_Score = 0; } try { siteModel.LoginScore = int.Parse(txtLoginScore.Text); } catch { siteModel.LoginScore = 0; } if (rdIsImgWaterMark2.Checked) { siteModel.IsImgWaterMark = true; } else { siteModel.IsImgWaterMark = false; } siteModel.WaterMarkStr = txtWaterMarkStr.Text; try { siteModel.WaterMarkFontSize = int.Parse(txtWaterMarkFontSize.Text); } catch { siteModel.WaterMarkFontSize = 0; } siteModel.WaterMarkFontName = ddlWaterMarkFontName.SelectedValue; if (Request.Form["txtWaterMarkFontColor"] != null && Request.Form["txtWaterMarkFontColor"] != "") { siteModel.WaterMarkFontColor = Request.Form["txtWaterMarkFontColor"]; } siteModel.WaterMarkIsBold = chkBoxWaterMarkIsBold.Checked; siteModel.WaterMarkPath = txtWaterMarkPath.Text; siteModel.WaterMarkHW = txtWaterMarkH.Text + "|" + txtWaterMarkW.Text; try { siteModel.WaterMarkLight = int.Parse(txtWaterMarkLight.Text); } catch { siteModel.WaterMarkLight = 0; } siteModel.WaterMarkPos = int.Parse(ddlWaterMarkPos.SelectedValue); siteModel.EmailServerAddress = txtEmailServerAddress.Text; siteModel.EmailServerUserName = txtServerUserName.Text; if (txtServerUserPass.Text.Trim().Length != 0) { siteModel.EmailServerUserPass = txtServerUserPass.Text; } else { siteModel.EmailServerUserPass = litUserPass.Text; } siteModel.IsOpenRZM = chkBoxIsOpenRZM.Checked; try { siteModel.DisabledLoginTime = int.Parse(txtDisabledLoginTime.Text.Trim()); } catch { siteModel.DisabledLoginTime = 0; } try { siteModel.UserClassCount = int.Parse(txtUserClassCount.Text.Trim()); } catch { siteModel.UserClassCount = 0; } siteModel.IsOpenRegLink = chkBosIsOpenRegLink.Checked; siteModel.IsCheckLink = chkIsCheckLink.Checked; try { infoModel.InfoCreateNum = int.Parse(txtInfoCreateNum.Text); if (infoModel.InfoCreateNum < 50 || infoModel.InfoCreateNum > 5000) { infoModel.InfoCreateNum = 100; } } catch { infoModel.InfoCreateNum = 100; } try { infoModel.SpecialInfoCreateNum = int.Parse(txtSpecialInfoCreateNum.Text); } catch { infoModel.SpecialInfoCreateNum = 0; } try { infoModel.SearchTime = int.Parse(txtSearchTime.Text); } catch { infoModel.SearchTime = 0; } try { infoModel.SearchResultPageSize = int.Parse(txtSearchResultPageSize.Text); } catch { infoModel.SearchResultPageSize = 0; } infoModel.IsOpenViewerDig = chkBoxIsOpenViewerDig.Checked; infoModel.ImgUploadType = txtUploadType.Text.Trim(); infoModel.VideoUploadType = txtUploadVideoType.Text.Trim(); infoModel.AudioUploadType = txtUploadAudioType.Text.Trim(); infoModel.SoftUploadType = txtUploadSoftType.Text.Trim(); infoModel.OtherUploadType = txtUploadOtherType.Text.Trim(); try { infoModel.HistoryTime = int.Parse(txtHistoryTime.Text.Trim()); } catch { infoModel.HistoryTime = 0; } B_Log.Add(LogType.Update, "配置全站参数设置成功"); Bll.SetSite(siteModel); Bll.SetInfoSite(infoModel); Function.ShowSysMsg(1, "<li>全站参数设置成功</li><li><a href='javascript:history.back()'>返回上一页</a></li>"); }