public void Default() { string errtitle = "<h3 class='panel-title'><span class='fa fa-exclamation-circle'></span> 不正确的访问</h3>"; int id = DataConverter.CLng(Request.QueryString["id"]); M_UserInfo mu = buser.SelReturnModel(Uid); if (mu.IsNull) { function.WriteErrMsg(errtitle, "主页ID违规,请使用/Space/Default?id=[uid]方式访问", ""); return; } else if (mu.State != 2) { function.WriteErrMsg(errtitle, "未通过认证会员无法开启个人主页! !", ""); return; } else if (mu.PageID < 1) { function.WriteErrMsg(errtitle, "用户未指定模板", ""); return; } bsMod = bsBll.SelReturnModel(mu.PageID); if (bsMod == null) { function.WriteErrMsg(errtitle, "指定的风格不存在", ""); return; } string tlp = function.VToP(SiteConfig.SiteOption.TemplateDir + bsMod.UserIndexStyle); if (!System.IO.File.Exists(tlp)) { function.WriteErrMsg(errtitle, "模板文件[" + bsMod.UserIndexStyle + "]不存在", ""); return; } string html = SafeSC.ReadFileStr(tlp); string ContentHtml = bll.CreateHtml(html); Response.Write(ContentHtml); }
public IActionResult SpaceManage() { B_CreateHtml bll = new B_CreateHtml(HttpContext); string errtitle = "<h3 class='panel-title'><span class='zi zi_exclamationCircle'></span> 不正确的访问</h3>"; int id = DataConverter.CLng(RequestEx["id"]); M_UserInfo mu = buser.SelReturnModel(Uid); if (mu.IsNull) { return(WriteErr(errtitle, "主页ID违规,请使用/User/Space/SpaceManage?id=[uid]方式访问", "")); } else if (mu.State != 2) { return(WriteErr(errtitle, "未通过认证会员无法开启个人主页! !", "")); } else if (mu.PageID < 1) { return(WriteErr(errtitle, "用户未指定模板", "")); } if (bsMod == null) { return(WriteErr(errtitle, "指定的风格不存在", "")); } string tlp = function.VToP(SiteConfig.SiteOption.TemplateDir + bsMod.UserIndexStyle); if (!System.IO.File.Exists(tlp)) { return(WriteErr(errtitle, "模板文件[" + bsMod.UserIndexStyle + "]不存在", "")); } string html = SafeSC.ReadFileStr(tlp); ViewBag.conhtml = bll.CreateHtml(html); return(View()); }
private void MyBind() { //后期改为XML存储或Json存储 M_RoleInfo roleMod = roleBll.SelReturnModel(RoleID); RoleName_L.Text = roleMod.RoleName; string json = SafeSC.ReadFileStr("/Config/AuthList.config"); AuthDT = JsonConvert.DeserializeObject <DataTable>(json); //AuthDT = SqlHelper.ExecuteTable(CommandType.Text, "SELECT layer,[name],[text],owner,[desc] FROM ZL_AuthList"); DataTable tabDT = GetAuthModel(); TabRPT.DataSource = tabDT; TabRPT.DataBind(); ownerRPT.DataSource = tabDT; ownerRPT.DataBind(); M_ARoleAuth authMod = authBll.SelModelByRid(RoleID); if (authMod != null) { function.Script(this, "SetChkVal('model','" + authMod.model + "');"); function.Script(this, "SetChkVal('content','" + authMod.content + "');"); function.Script(this, "SetChkVal('crm','" + authMod.crm + "');"); function.Script(this, "SetChkVal('label','" + authMod.label + "');"); function.Script(this, "SetChkVal('shop','" + authMod.shop + "');"); function.Script(this, "SetChkVal('store','" + authMod.store + "');"); function.Script(this, "SetChkVal('page','" + authMod.page + "');"); function.Script(this, "SetChkVal('user','" + authMod.user + "');"); function.Script(this, "SetChkVal('other','" + authMod.other + "');"); function.Script(this, "SetChkVal('pub','" + authMod.pub + "');"); } //AuthDT=AuthDT.DefaultView.ToTable(false, "layer,name,text,owner,desc".Split(',')); //string json = JsonConvert.SerializeObject(AuthDT,Formatting.Indented); //SafeSC.WriteFile("/test/AuthList.config", json); }
public IActionResult StoreContent() { if (ItemID < 1) { return(WriteErr("[产生错误的可能原因:您访问的商品信息不存在!")); } M_Product pinfo = proBll.GetproductByid(ItemID); if (pinfo == null) { return(WriteErr("[产生错误的可能原因:您访问的商品信息不存在!]")); } if (pinfo.UserShopID < 1) { Response.Redirect("/Shop/" + ItemID + ""); } M_CommonData storeMod = conBll.Store_SelModel(pinfo.UserShopID); if (!StoreCheck(storeMod, ref err)) { return(WriteErr(err)); } M_Store_Style styleMod = styleBll.SelReturnModel(storeMod.DefaultSkins); if (styleMod == null || string.IsNullOrEmpty(styleMod.Template_Content)) { return(WriteErr("尚未定义模板路径")); } string tlppath = styleMod.Template_Content; string ContentHtml = SafeSC.ReadFileStr(SiteConfig.SiteOption.TemplateDir + "/" + tlppath); ContentHtml = bll.CreateHtml(ContentHtml, 0, ItemID, 0); return(HtmlToClient(ContentHtml)); }
protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e) { string fname = e.CommandArgument.ToString(); string logpath = GetLogPath() + fname; switch (e.CommandName) { case "view": viewdiv.Visible = true; egvdiv.Visible = false; Curfname_Hid.Value = fname; string text = SafeSC.ReadFileStr(logpath); if (text.Trim().Length < 30) { text = "该日志无记录"; } LogTxt_Li.Text = text.Replace("\r\n", "<br />"); //替换文本换行 break; case "down": SafeSC.DownFile(logpath); break; case "del2": SafeSC.DelFile(logpath); MyBind(); break; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindType(); int id = DataConverter.CLng(Request.QueryString["id"]); M_Exam_Sys_Questions mq = bq.GetSelect(id); if (mq != null && mq.p_id > 0) { this.ddlType.SelectedValue = mq.p_Type.ToString(); ddlType.Enabled = false; this.shuming.Text = mq.p_shuming.ToString(); hfpid.Value = mq.p_id.ToString(); txtP_Content.Text = mq.p_Content; hffilename.Value = mq.p_Shipin; txtCourse.Text = mq.p_defaultScores.ToString(); hfParentId.Value = mq.parentId.ToString(); ddlNumber1.SelectedValue = mq.p_ChoseNum.ToString(); hfoption.Value = SafeSC.ReadFileStr(M_Exam_Sys_Questions.OptionDir + mq.p_id + ".opt"); hfanw.Value = mq.p_Answer; } else { ddlType.Enabled = true; hfParentId.Value = Request.QueryString["p_Id"]; } option(); } Call.SetBreadCrumb(Master, "<li>教育模块</li><li><a href='QuestionManage.aspx'>在线考试系统</a></li><li>课程管理</li>"); }
public IActionResult StoreIndex() { //if (ItemID < 1) { return WriteErr("店铺ID错误,StoreIndex?id=店铺ID");return; } M_CommonData storeMod = conBll.Store_SelModel(ItemID); if (!StoreCheck(storeMod, ref err)) { return(WriteErr(err)); } string tlppath = ""; if (!string.IsNullOrEmpty(storeMod.Template)) { tlppath = storeMod.Template; } else { M_Store_Style styleMod = styleBll.SelReturnModel(storeMod.DefaultSkins); if (styleMod != null) { tlppath = styleMod.Template_Index; } } if (string.IsNullOrEmpty(tlppath)) { return(WriteErr("尚未定义模板路径")); } string ContentHtml = SafeSC.ReadFileStr(SiteConfig.SiteOption.TemplateDir + "/" + tlppath); ContentHtml = bll.CreateHtml(ContentHtml, 0, ItemID, 0); return(HtmlToClient(ContentHtml)); }
private string GetAppUrl(M_QrCode model, DeviceHelper.Agent agent, DeviceHelper.Brower brower) { string url = ""; if (string.IsNullOrEmpty(model.Urls)) { return(url); } url = codeBll.GetUrlByAgent(agent, model); switch (agent) { case DeviceHelper.Agent.iPhone: case DeviceHelper.Agent.iPad: switch (brower) { case DeviceHelper.Brower.Micro: //如果是微信,并且是分发市场的Url,则提示其用外置浏览器打开 string html = SafeSC.ReadFileStr("/APP/AppStore.html"); //html = html.Replace("@Device", ""); Response.Clear(); Response.Write(html); Response.Flush(); Response.End(); break; } break; } return(url); }
public ActionResult Default() { B_Admin badmin = new B_Admin(); if (badmin.CheckLogin() && !buser.CheckLogin()) { M_AdminInfo adminMod = B_Admin.GetLogin(); M_UserInfo mu = new M_UserInfo(); if (adminMod.AddUserID > 0) { mu = buser.SelReturnModel(adminMod.AddUserID); } if (mu.UserID < 1) { mu = buser.AuthenticateUser(adminMod.AdminName, adminMod.AdminPassword, true); } if (mu.UserID > 0) { buser.SetLoginState(mu); } } B_User.CheckIsLogged(Request.RawUrl); ViewBag.url = "www.z01.com"; ViewBag.showmsg = !DomainCheck(); ViewBag.authsp = SafeSC.ReadFileStr("/APP/Other/auth.html"); int APKMode = DataConverter.CLng(Request["APKMode"]); ViewBag.apkmode = APKMode; return(View()); }
public IActionResult CSSEdit() { B_Admin badmin = new B_Admin(); B_ARoleAuth.AuthCheckEx(ZLEnum.Auth.system, "tlp"); //-------------------------------- if (!string.IsNullOrEmpty(FilePath)) { string CSSPath = CSSBaseDir + FilePath; string fileExt = Path.GetExtension(CSSPath); //.css string fileName = Path.GetFileName(CSSPath); //mobile.css if (fileExt.ToLower().Equals(".css")) { //TxtFilename.Attributes.Add("disabled", "disabled"); //TxtFilename.Value = fileName.Split('.')[0]; } else { return(WriteErr("无权修改.css以外的文件!")); } ViewBag.fcontent = SafeSC.ReadFileStr(CSSPath); ViewBag.fname = fileName; } ViewBag.FilePath = FilePath; return(View()); }
public void ErrToClient(string str) { string html = SafeSC.ReadFileStr("/Prompt/error.html"); html = html.Replace("@msg", str); Response.Clear(); Response.Write(html); Response.Flush(); Response.End(); }
protected void Page_Load(object sender, EventArgs e) { if (!B_ARoleAuth.Check(ZLEnum.Auth.label, "TemplateEdit")) { function.WriteErrMsg("没有权限进行此项操作"); } if (!IsPostBack) { Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li><a href='TemplateManage.aspx'>模板管理</a></li><li>模板编辑</li>" + Call.GetHelp(26)); dsTable = dsBll.Sel(); ViewState["dsTable"] = dsTable; DPBind(); if (string.IsNullOrEmpty(Request.QueryString["filepath"])) { ShowPath = "/"; } else { ShowPath = Request.QueryString["filepath"]; } string FileExp = Path.GetExtension(FileVPath); if (!string.IsNullOrEmpty(FileExp)) { FileName = Path.GetFileName(FileVPath); ShowPath = ShowPath.Replace(FileName, "").Replace("//", "/"); TempUrl_L.Text = ShowPath + FileName; string fname = FileName.Contains(".") ? FileName.Split('.')[0] : FileName; string exname = FileName.Contains(".") ? FileName.Split('.')[1] : "html"; if (exname.ToLower().Equals("html")) { TxtFilename.Value = fname; name_L.Text = "." + exname; } else { function.WriteErrMsg("无权修改.html以外的文件!"); } textContent.Text = SafeSC.ReadFileStr(FileVPath); Hdnmethod.Value = "append"; edit_div.Visible = true; if (Path.GetExtension(FileVPath).ToLower().Equals(".html")) { ViewEdit_A.Visible = true; ViewEdit_A.HRef = customPath2 + "Template/Design.aspx?vpath=" + HttpUtility.UrlEncode(FileVPath); } } else { FileName = ""; TxtFilename.Value = ""; TxtFilename.Visible = true; Hdnmethod.Value = "add"; add_div.Visible = true; } lblSys.Text = bfun.GetSysLabel(); //系统标签列表 lblFun.Text = bfun.GetFunLabel(); //扩展函数列表 HdnShowPath.Value = ShowPath; } }
public string GetSubmit() { string option = SafeSC.ReadFileStr(M_Exam_Sys_Questions.OptionDir + Eval("p_id") + ".opt"); int id = Convert.ToInt32(Eval("p_id")); JArray arr = JsonConvert.DeserializeObject <JArray>(option); StringBuilder builder = new StringBuilder(); //单,多,填,解 switch (DataConverter.CLng(Eval("p_Type"))) { case (int)M_Exam_Sys_Questions.QType.Radio: { if (arr == null || arr.Count < 1) { return("未定义选项"); } string name = "srad_" + id; string tlp = "<li class='opitem'><label><input type='radio' name='{0}' value='{1}'>{1}. {2}</label></li>"; foreach (JObject obj in arr) { builder.Append(string.Format(tlp, name, obj["op"], obj["val"])); } } break; case (int)M_Exam_Sys_Questions.QType.Multi: { if (arr == null || arr.Count < 1) { return("未定义选项"); } string name = "mchk_" + id; string tlp = "<li class='opitem'><label><input class='opitem' type='checkbox' name='{0}' value='{1}'>{1}. {2}</label></li>"; foreach (JObject obj in arr) { builder.Append(string.Format(tlp, name, obj["op"], obj["val"])); } } break; case (int)M_Exam_Sys_Questions.QType.FillBlank: { //string tlp = "<div contenteditable='true' class='answerdiv'>解:</div>"; //builder.Append(tlp); } break; case (int)M_Exam_Sys_Questions.QType.Answer: //放置一个ueditor { string name = "answer_" + id; string tlp = "<div id='" + name + "' contenteditable='true' class='answerdiv'>解:</div>"; builder.Append(tlp); } break; } return(builder.ToString()); }
protected void Add_Btn_Click(object sender, EventArgs e) { if (File_UP.PostedFile.ContentLength < 100) { function.Script(this, "alert('请先选择文件');"); } string vpath = "/UploadFiles/Admin/Temp/WordConver/"; string exname = Path.GetExtension(File_UP.FileName).ToLower().Replace(".", ""); //string fpath = SafeSC.SaveFile(vpath, File_UP.PostedFile); string fpath = vpath + Path.GetFileName(File_UP.FileName); File_UP.SaveAs(fpath); if ("doc,docx,rtf".Split(',').Contains(exname)) { Document doc = new Document(Server.MapPath(fpath)); vpath = vpath + function.GetRandomString(3) + "/"; string dirpath = Server.MapPath(vpath); string htmlpath = dirpath + function.GetRandomString(3) + ".html"; if (!Directory.Exists(dirpath)) { Directory.CreateDirectory(dirpath); } doc.Save(htmlpath, SaveFormat.Html); string text = SafeSC.ReadFileStr(htmlpath); text = regHelper.GetValueBySE(text, "<body>", "</body>", false); text = text.Replace("<img", " <img"); MatchCollection matchs = regHelper.GetValuesBySE(text, "<img", "/>"); foreach (Match mc in matchs) { if (string.IsNullOrEmpty(mc.Value)) { continue; } string src = regHelper.GetValueBySE(mc.Value, "src=\"", "\"", false); string newvalue = ""; newvalue = mc.Value.Replace(src, vpath + src); text = text.Replace(mc.Value, newvalue); } text = text.Replace(" ", ""); Content_Div.InnerHtml = text; function.Script(this, "SetContent();"); } else if (exname.Equals("txt")) { string text = SafeSC.ReadFileStr(Server.MapPath(fpath), true); Content_Div.InnerHtml = text; function.Script(this, "SetContent();"); } else if (exname.Equals("rtf")) { } else { function.Script(this, "alert('请上传doc,docx文件!!');"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { String content = SafeSC.ReadFileStr(vdir + TlpName); TxtTempName.Text = TlpName; TxtContent.Value = content; Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + CustomerPageAction.customPath2 + "User/UserManage.aspx'>用户管理</a></li><li><a href='MailSysTlp.aspx'>系统模板</a></li><li class='active'>修改系统模板</li>"); } }
//加载指定模板页,如不存在,则加载公用模板页(内容|商品详情) private string ReadHtml(M_Design_MBSite mbMod) { string vpath = "/design/mobile/tlp/" + mbMod.TlpID + "/" + PageName + ".html"; string ppath = Server.MapPath(vpath); if (!File.Exists(ppath)) { vpath = "/design/mobile/tlp/common/" + PageName + ".html"; } return(SafeSC.ReadFileStr(vpath)); }
/// <summary> /// 用于加载radio等模板 /// </summary> public static string LoadTlp(string name, string[] names, string[] values) { string tlpPath = tlpDir + name + ".html"; string html = SafeSC.ReadFileStr(tlpPath); for (int i = 0; i < names.Length; i++) { html = html.Replace("@" + names[i], values[i]); } return(html); }
private void MyBind() { pageMod = pageBll.SelReturnModel(Mid); if (!File.Exists(Server.MapPath(pageMod.PageUrl))) { function.WriteErrMsg(pageMod.PageUrl + "文件不存在"); } PageStr_T.Text = SafeSC.ReadFileStr(pageMod.PageUrl); CodeStr_T.Text = SafeSC.ReadFileStr(pageMod.PageUrl + ".cs"); Call.SetBreadCrumb(Master, "<li><a href='" + customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + customPath2 + "Config/SiteInfo.aspx'>系统设置</a></li><li><a href=\"PageList.aspx\">页面列表</a></li><li class='active'><a href='" + Request.RawUrl + "'>页面源码</a>页面:" + pageMod.PageAlias + "[" + pageMod.PageUrl + "]</li>"); }
public ActionResult TlpShow() { string vpath = Request["vpath"]; if (string.IsNullOrEmpty(vpath)) { function.WriteErrMsg("路径不能为空"); } string html = SafeSC.ReadFileStr(VPath); return(Content(chtmlBll.CreateHtml(html))); }
private void MyBind() { string html = SafeSC.ReadFileStr("/manage/shop/addon/exps/" + ExpTlp_DP.SelectedValue + ".html"); maindiv.InnerHtml = html; M_Order_ExpSender senderMod = senderBll.SelReturnModel(DataConvert.CLng(SendMan_DP.SelectedValue)); if (senderMod != null) { SendMan_Hid.Value = JsonConvert.SerializeObject(senderMod); } }
protected void btnReset_Click(object sender, EventArgs e) { if (Hdnmethod.Value == "add") { textContent.Text = ""; } if (Hdnmethod.Value == "append") { string str = SafeSC.ReadFileStr(FileVPath); textContent.Text = str; } }
private void SendMailByIDS(string ids) { if (!string.IsNullOrEmpty(ids))//发送邮件 { string emailTlp = SafeSC.ReadFileStr("/APP/Other/mail.html"); DataTable dt = authBll.SelByIDS(ids); foreach (string tid in ids.Split(',')) { dt.DefaultView.RowFilter = "ID=" + tid; SendAuthedMail(emailTlp, dt.DefaultView.ToTable()); } } }
protected void BeginUP_Btn_Click(object sender, EventArgs e) { //string[] exts="txt,html,htm,shtml".Split(','); //string ext = Path.GetFileName(Html_UP.FileName).ToLower().Replace(".", ""); //if (!exts.Contains(ext) || string.IsNullOrEmpty(ext)) { function.WriteErrMsg("请上传文本或Html文件"); } if (!Html_UP.HasFile) { return; } string vpath = "/UploadFiles/temp.txt"; Html_UP.SaveAs(vpath); Html_T.Text = SafeSC.ReadFileStr(vpath); //读取Html中的内容 }
public void App_Create() { if (!Directory.Exists(@"C:\APPTlp\")) { function.WriteErrMsg("环境未配置,APP模板目录不存在!"); } string xml = SafeSC.ReadFileStr("/APP/Res/config.xml"); int Mid = DataConverter.CLng(Request["ID"]); M_UserInfo mu = buser.GetLogin(); M_App appMod = appBll.Select(Mid); if (appMod == null || DataConverter.CLng(appMod.UserID) != mu.UserID) { function.WriteErrMsg("APP不存在,或你无权访问该APP"); } //------------------------------------------------------------------ appMod.AppName = Request.Form["appname"].Trim(); appMod.Author = Request.Form["author"].Trim(); appMod.Description = Request.Form["description"]; appMod.Template = ""; int tlpID = DataConverter.CLng(Request.Form["idrad"]); if (tlpID > 0) { M_APP_APPTlp tlpMod = tlpBll.SelReturnModel(tlpID); appMod.Template = Server.MapPath(tlpMod.TlpUrl); } string appicon = Request.Form["appicon"]; string splash = Request.Form["splash"]; SaveFile(appMod.APPDir + "\\icon.png", appicon, "/APP/Res/icon.png"); //安装时显示的图标 SaveFile(appMod.APPDir + "\\screen.png", splash, "/APP/Res/screen.png"); //程序图标 switch (appMod.APKMode) { case 0: xml = xml.Replace("@launchUrl", appMod.Furl); break; case 1: xml = xml.Replace("@launchUrl", "file:///android_asset/www/index.html"); break; } xml = xml.Replace("@APPName", appMod.AppName) .Replace("@author", appMod.Author).Replace("@description", appMod.Description); System.IO.File.WriteAllBytes(appMod.APPDir + "\\config.xml", System.Text.Encoding.UTF8.GetBytes(xml)); appBll.Update(appMod); function.WriteSuccessMsg("已提交APP生成申请,正在审核生成,请稍等一分钟左右", "APPList"); }
protected void Page_Load(object sender, EventArgs e) { M_Product proMod = pll.GetproductByid(ItemID); OrderCommon.ProductCheck(proMod); int CPage = string.IsNullOrEmpty(base.Request.QueryString["page"]) ? 1 : DataConverter.CLng(base.Request.QueryString["page"]); if (CPage <= 0) { CPage = 1; } M_Node nodeinfo = bnode.GetNodeXML(proMod.Nodeid); if (nodeinfo.PurviewType) { if (!buser.CheckLogin()) { function.WriteErrMsg("该信息所属栏目需登录验证,请先登录再进行此操作!", "/User/login.aspx"); } else { //此处以后可以加上用户组权限检测 } } M_ModelInfo modelinfo = bmode.GetModelById(proMod.ModelID); string TempNode = bnode.GetModelTemplate(proMod.Nodeid, proMod.ModelID); string TemplateDir = modelinfo.ContentModule; if (!string.IsNullOrEmpty(TempNode)) { TemplateDir = TempNode; } if (string.IsNullOrEmpty(TemplateDir)) { Response.Write("[产生错误的可能原因:该商品所属模型未指定模板!]"); } else { string contentHtml = SafeSC.ReadFileStr(SiteConfig.SiteOption.TemplateDir + "/" + TemplateDir); contentHtml = this.shll.CreateShopHtml(contentHtml, 0, 0); contentHtml = this.bll.CreateHtml(contentHtml, 0, ItemID, 0); Response.Write(contentHtml); } }
public IActionResult TxtLogContent() { string fname = RequestEx["fname"]; string logpath = GetLogPath() + fname; string text = SafeSC.ReadFileStr(logpath); if (text.Trim().Length < 30) { text = "该日志无记录"; } else { text = text.Replace("\r\n", "<br />"); } ViewBag.text = text; return(View()); }
protected void LoadPage_Btn_Click(object sender, EventArgs e) { string vpath = Url_T.Text.Trim(); string ppath = Server.MapPath(vpath); if (string.IsNullOrEmpty(vpath)) { function.WriteErrMsg("加载路径不能为空"); } if (!File.Exists(ppath)) { function.WriteErrMsg(vpath + "文件不存在"); } string html = SafeSC.ReadFileStr(vpath); PageAlias_T.Text = htmlBll.GetPage(html).Title; PageName_T.Text = Path.GetFileNameWithoutExtension(ppath); }
protected void Page_Load(object sender, EventArgs e) { if (string.IsNullOrEmpty(VPath)) { function.WriteErrMsg("路径不能为空"); } string html = SafeSC.ReadFileStr(VPath); if (string.IsNullOrEmpty(Request.QueryString["PreView"])) { //区块编辑,能否解析但不生成? //create.IsDesign = 2; string realhtml = create.CreateHtml(html); //tring designJson = JsonConvert.SerializeObject(create.DesignList); //throw new Exception(designJson); //----- Regex reg = new Regex(@"(<body)[\s\S]*(/body>)", RegexOptions.IgnoreCase); string bak_html = reg.Replace(html, new MatchEvaluator(OutPutMatch));//去除Body html = html.Replace("{$CssDir/}", Call.GetLabel("{$CssDir/}")); html = html.Replace("{ZL:Boot()/}", Call.GetLabel("{ZL:Boot()/}")); string menu = "<div class='contextMenu' id='rmenu'><ul>"; menu += "<li id='edit'><span class='fa fa-pencil'></span><span>编辑</span></li>"; menu += "<li id='block'><span class='fa fa-th-large'></span><span>区块编辑</span></li>"; //menu += "<li id='drag'><span class='fa fa-arrows'></span><span>开启拖动</span></li>"; //menu += "<li id='enddrag'><span class='fa fa-stop'></span><span>停止拖动</span></li>"; menu += "</ul></div>"; StringBuilder builder = new StringBuilder(); builder.Append("<script src='/JS/jquery-ui.min.js'></script>"); builder.Append("<script src='/JS/Design/ZL_Tlp.js?ver=1.2'></script>"); builder.Append("<script src='/JS/jquery.contextmenu.r2.js'></script>"); builder.Append("<script>parent.SaveHead('" + HttpUtility.UrlEncode(bak_html) + "');</script>"); //区块编辑 //<script src='/JS/Controls/ZL_Dialog.js'></script><script src='/JS/Design/ZL_Design_Editor.js'></script> //string tlp = "<div id='design_div'><link href='/JS/Design/ZL_Design.css' rel='stylesheet' /></div><script>var labelJson=" + designJson + ";</script>"; //html = html.Replace("<body>", "<body>" + Call.Boundary);//将flag之前的全截掉再加body //Response.Write(html + "<div id='editor_div'>" + menu + builder.ToString() + "</div>" + tlp); } else//开启预览 { Response.Write(create.CreateHtml(html)); } }
protected void Page_Load(object sender, EventArgs e) { IsInStall(); if (!IsPostBack) { TxtSiteUrl.Text = "http://" + Request.ServerVariables["HTTP_HOST"].ToString(); switch (System.Globalization.CultureInfo.CurrentCulture.Name.ToLower()) { case "en-us": Licence_Lit.Text = SafeSC.ReadFileStr("/Config/ZL_licence_en.txt", true); break; case "zh-cn": default: Licence_Lit.Text = SafeSC.ReadFileStr("/Config/ZL_licence.txt", true); break; } } }
public List <M_Release> GetModel() { string ppath = function.VToP(vpath); if (!File.Exists(ppath)) { return(null); } string json = SafeSC.ReadFileStr(vpath); if (!string.IsNullOrEmpty(json)) { return(JsonConvert.DeserializeObject <List <M_Release> >(json)); } else { return(null); } }