Example #1
0
 /// <summary>
 /// 写入站点配置文件
 /// </summary>
 public Model.sysconfig saveConifg(Model.sysconfig model, string configFilePath)
 {
     lock (lockHelper)
     {
         SerializationHelper.Save(model, configFilePath);
     }
     return(model);
 }
Example #2
0
        /// <summary>
        /// 浏览图片
        /// </summary>
        private void EditorListImage(HttpContext context)
        {
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            string          filePath  = sysConfig.webpath + sysConfig.filepath + "/"; //站点目录+上传目录
            string          fileTypes = ".gif,.jpg,.jpeg,.png,.bmp";                  //允许浏览的文件扩展名

            ListFileManager(context, filePath, fileTypes);
        }
Example #3
0
        /// <summary>
        /// 浏览文件
        /// </summary>
        private void EditorListFile(HttpContext context)
        {
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            string          filePath  = sysConfig.webpath + sysConfig.filepath + "/";                                                                            //站点目录+上传目录
            string          fileTypes = ".png,.jpg,.jpeg,.gif,.bmp,.flv,.swf,.mkv,.avi,.rm,.rmvb,.mpeg,.mpg,.ogg,.ogv,.mov,.wmv,"
                                        + ".mp4,.webm,.mp3,.wav,.mid,.rar,.zip,.tar,.gz,.7z,.bz2,.cab,.iso,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt,.md,.xml"; //允许浏览的文件扩展名

            ListFileManager(context, filePath, fileTypes);
        }
Example #4
0
 /// <summary>
 ///  读取配置文件
 /// </summary>
 public Model.sysconfig loadConfig()
 {
     Model.sysconfig model = CacheHelper.Get <Model.sysconfig>(DTKeys.CACHE_SYS_CONFIG);
     if (model == null)
     {
         CacheHelper.Insert(DTKeys.CACHE_SYS_CONFIG, dal.loadConfig(Utils.GetXmlMapPath(DTKeys.FILE_SYS_XML_CONFING)),
                            Utils.GetXmlMapPath(DTKeys.FILE_SYS_XML_CONFING));
         model = CacheHelper.Get <Model.sysconfig>(DTKeys.CACHE_SYS_CONFIG);
     }
     return(model);
 }
Example #5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd  = txtPassword.Text.Trim();

            if (userName.Equals("") || userPwd.Equals(""))
            {
                msgtip.InnerHtml = "请输入用户名或密码";
                return;
            }
            if (Session["AdminLoginSun"] == null)
            {
                Session["AdminLoginSun"] = 1;
            }
            else
            {
                Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
            }
            //判断登录错误次数
            if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 5)
            {
                msgtip.InnerHtml = "错误超过5次,关闭浏览器重新登录!";
                return;
            }
            BLL.manager   bll   = new BLL.manager();
            Model.manager model = bll.GetModel(userName, userPwd, true);
            if (model == null)
            {
                msgtip.InnerHtml = "用户名或密码有误,请重试!";
                return;
            }
            Session[DTKeys.SESSION_ADMIN_INFO] = model;
            Session.Timeout = 45;
            //写入登录日志
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            if (sysConfig.logstatus > 0)
            {
                new BLL.manager_log().Add(model.id, model.user_name, DTEnums.ActionEnum.Login.ToString(), "用户登录");
            }
            //写入Cookies
            Utils.WriteCookie("DTRememberName", model.user_name, 14400);
            Utils.WriteCookie("AdminName", "YTS", model.user_name);
            Utils.WriteCookie("AdminPwd", "YTS", model.password);
            Response.Redirect("index.aspx");
            return;
        }
Example #6
0
        /// <summary>
        /// 抓取远程图片
        /// </summary>
        private void EditorCatchImage(HttpContext context)
        {
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            if (sysConfig.fileremote == 0)
            {
                Hashtable hash = new Hashtable();
                hash["state"] = "未开启远程图片本地化";
                context.Response.AddHeader("Content-Type", "text/plain; charset=UTF-8");
                context.Response.Write(JSON.Serializer(hash));
                context.Response.End();
            }
            string[] sourcesUriArr = context.Request.Form.GetValues("source[]");
            if (sourcesUriArr == null || sourcesUriArr.Length == 0)
            {
                Hashtable hash = new Hashtable();
                hash["state"] = "参数错误:没有指定抓取源";
                context.Response.AddHeader("Content-Type", "text/plain; charset=UTF-8");
                context.Response.Write(JSON.Serializer(hash));
                context.Response.End();
            }
            UpLoad           upLoad   = new UpLoad();           //初始化上传类
            List <Hashtable> fileList = new List <Hashtable>(); //存储上传成功的文件列表

            foreach (string sourcesUri in sourcesUriArr)
            {
                string remsg = upLoad.RemoteSaveAs(sourcesUri);
                Dictionary <string, object> dic = JSON.Deserialize <Dictionary <string, object> >(remsg);
                //如果抓取成功则加入文件列表
                if (dic["status"].ToString() == "1")
                {
                    Hashtable hash = new Hashtable();
                    hash["state"]  = "SUCCESS";
                    hash["source"] = sourcesUri;
                    hash["url"]    = dic["path"].ToString();
                    fileList.Add(hash);
                }
            }
            Hashtable result = new Hashtable();

            result["state"] = "SUCCESS";
            result["list"]  = fileList;
            context.Response.AddHeader("Content-Type", "text/plain; charset=UTF-8");
            context.Response.Write(JSON.Serializer(result));
            context.Response.End();
        }
Example #7
0
        private void UpLoadFile(HttpContext context)
        {
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            //检查是否允许匿名上传

            /*if (sysConfig.fileanonymous == 0 && !new ManagePage().IsAdminLogin() && !new BasePage().IsUserLogin())
             * {
             *  context.Response.Write("{\"status\": 0, \"msg\": \"禁止匿名非法上传!\"}");
             *  return;
             * }*/

            string _delfile = DTRequest.GetString("DelFilePath");                                  //要删除的文件
            string fileName = DTRequest.GetString("name");                                         //文件名

            byte[] byteData     = FileHelp.ConvertStreamToByteBuffer(context.Request.InputStream); //获取文件流
            bool   _iswater     = false;                                                           //默认不打水印
            bool   _isthumbnail = false;                                                           //默认不生成缩略图

            if (DTRequest.GetQueryString("IsWater") == "1")
            {
                _iswater = true;
            }
            if (DTRequest.GetQueryString("IsThumbnail") == "1")
            {
                _isthumbnail = true;
            }
            if (byteData.Length == 0)
            {
                context.Response.Write("{\"status\": 0, \"msg\": \"请选择要上传文件!\"}");
                return;
            }
            UpLoad upLoad = new UpLoad();
            string msg    = upLoad.FileSaveAs(byteData, fileName, _isthumbnail, _iswater);

            //删除已存在的旧文件
            if (!string.IsNullOrEmpty(_delfile))
            {
                upLoad.DeleteFile(_delfile);
            }
            //返回成功信息
            context.Response.Write(msg);
            context.Response.End();
        }
Example #8
0
 /// <summary>
 ///  保存配置文件
 /// </summary>
 public Model.sysconfig saveConifg(Model.sysconfig model)
 {
     return(dal.saveConifg(model, Utils.GetXmlMapPath(DTKeys.FILE_SYS_XML_CONFING)));
 }
Example #9
0
 public UpLoad()
 {
     sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
 }
Example #10
0
 public UpLoad()
 {
     sysConfig = new BLL.sysconfig().loadConfig();
 }
Example #11
0
        private void ShowInfo()
        {
            BLL.sysconfig   bll   = new BLL.sysconfig();
            Model.sysconfig model = bll.loadConfig();

            webname.Text    = model.webname;
            weburl.Text     = model.weburl;
            webcompany.Text = model.webcompany;
            webaddress.Text = model.webaddress;
            webtel.Text     = model.webtel;
            webfax.Text     = model.webfax;
            webmail.Text    = model.webmail;
            webcrod.Text    = model.webcrod;

            webpath.Text               = model.webpath;
            webmanagepath.Text         = model.webmanagepath;
            staticstatus.SelectedValue = model.staticstatus.ToString();
            staticextension.Text       = model.staticextension;
            if (model.memberstatus == 1)
            {
                memberstatus.Checked = true;
            }
            else
            {
                memberstatus.Checked = false;
            }
            if (model.commentstatus == 1)
            {
                commentstatus.Checked = true;
            }
            else
            {
                commentstatus.Checked = false;
            }
            if (model.logstatus == 1)
            {
                logstatus.Checked = true;
            }
            else
            {
                logstatus.Checked = false;
            }
            if (model.webstatus == 1)
            {
                webstatus.Checked = true;
            }
            else
            {
                webstatus.Checked = false;
            }
            webclosereason.Text = model.webclosereason;
            webcountcode.Text   = model.webcountcode;

            smsapiurl.Text   = model.smsapiurl;
            smsusername.Text = model.smsusername;
            if (!string.IsNullOrEmpty(model.smspassword))
            {
                smspassword.Attributes["value"] = defaultpassword;
            }
            labSmsCount.Text = GetSmsCount(); //取得短信数量

            emailsmtp.Text = model.emailsmtp;
            if (model.emailssl == 1)
            {
                emailssl.Checked = true;
            }
            else
            {
                emailssl.Checked = false;
            }
            emailport.Text     = model.emailport.ToString();
            emailfrom.Text     = model.emailfrom;
            emailusername.Text = model.emailusername;
            if (!string.IsNullOrEmpty(model.emailpassword))
            {
                emailpassword.Attributes["value"] = defaultpassword;
            }
            emailnickname.Text = model.emailnickname;

            filepath.Text               = model.filepath;
            filesave.SelectedValue      = model.filesave.ToString();
            fileremote.SelectedValue    = model.fileremote.ToString();
            fileextension.Text          = model.fileextension;
            videoextension.Text         = model.videoextension;
            attachsize.Text             = model.attachsize.ToString();
            videosize.Text              = model.videosize.ToString();
            imgsize.Text                = model.imgsize.ToString();
            imgmaxheight.Text           = model.imgmaxheight.ToString();
            imgmaxwidth.Text            = model.imgmaxwidth.ToString();
            thumbnailheight.Text        = model.thumbnailheight.ToString();
            thumbnailwidth.Text         = model.thumbnailwidth.ToString();
            thumbnailmode.SelectedValue = model.thumbnailmode;
            watermarktype.SelectedValue = model.watermarktype.ToString();
            watermarkposition.Text      = model.watermarkposition.ToString();
            watermarkimgquality.Text    = model.watermarkimgquality.ToString();
            watermarkpic.Text           = model.watermarkpic;
            watermarktransparency.Text  = model.watermarktransparency.ToString();
            watermarktext.Text          = model.watermarktext;
            watermarkfont.SelectedValue = model.watermarkfont;
            watermarkfontsize.Text      = model.watermarkfontsize.ToString();
        }
Example #12
0
        /// <summary>
        /// 保存配置信息
        /// </summary>
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_config", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            BLL.sysconfig   bll   = new BLL.sysconfig();
            Model.sysconfig model = bll.loadConfig();
            try
            {
                model.webname    = webname.Text;
                model.weburl     = weburl.Text;
                model.webcompany = webcompany.Text;
                model.webaddress = webaddress.Text;
                model.webtel     = webtel.Text;
                model.webfax     = webfax.Text;
                model.webmail    = webmail.Text;
                model.webcrod    = webcrod.Text;

                model.webpath         = webpath.Text;
                model.webmanagepath   = webmanagepath.Text;
                model.staticstatus    = Utils.StrToInt(staticstatus.SelectedValue, 0);
                model.staticextension = staticextension.Text;
                if (memberstatus.Checked == true)
                {
                    model.memberstatus = 1;
                }
                else
                {
                    model.memberstatus = 0;
                }
                if (commentstatus.Checked == true)
                {
                    model.commentstatus = 1;
                }
                else
                {
                    model.commentstatus = 0;
                }
                if (logstatus.Checked == true)
                {
                    model.logstatus = 1;
                }
                else
                {
                    model.logstatus = 0;
                }
                if (webstatus.Checked == true)
                {
                    model.webstatus = 1;
                }
                else
                {
                    model.webstatus = 0;
                }
                model.webclosereason = webclosereason.Text;
                model.webcountcode   = webcountcode.Text;

                model.smsapiurl   = smsapiurl.Text;
                model.smsusername = smsusername.Text;
                //判断密码是否更改
                if (smspassword.Text.Trim() != "" && smspassword.Text.Trim() != defaultpassword)
                {
                    model.smspassword = Utils.MD5(smspassword.Text.Trim());
                }

                model.emailsmtp = emailsmtp.Text;
                if (emailssl.Checked == true)
                {
                    model.emailssl = 1;
                }
                else
                {
                    model.emailssl = 0;
                }
                model.emailport     = Utils.StrToInt(emailport.Text.Trim(), 25);
                model.emailfrom     = emailfrom.Text;
                model.emailusername = emailusername.Text;
                //判断密码是否更改
                if (emailpassword.Text.Trim() != defaultpassword)
                {
                    model.emailpassword = DESEncrypt.Encrypt(emailpassword.Text, model.sysencryptstring);
                }
                model.emailnickname = emailnickname.Text;

                model.filepath              = filepath.Text;
                model.filesave              = Utils.StrToInt(filesave.SelectedValue, 2);
                model.fileremote            = Utils.StrToInt(fileremote.SelectedValue, 0);
                model.fileextension         = fileextension.Text;
                model.videoextension        = videoextension.Text;
                model.attachsize            = Utils.StrToInt(attachsize.Text.Trim(), 0);
                model.videosize             = Utils.StrToInt(videosize.Text.Trim(), 0);
                model.imgsize               = Utils.StrToInt(imgsize.Text.Trim(), 0);
                model.imgmaxheight          = Utils.StrToInt(imgmaxheight.Text.Trim(), 0);
                model.imgmaxwidth           = Utils.StrToInt(imgmaxwidth.Text.Trim(), 0);
                model.thumbnailheight       = Utils.StrToInt(thumbnailheight.Text.Trim(), 0);
                model.thumbnailwidth        = Utils.StrToInt(thumbnailwidth.Text.Trim(), 0);
                model.thumbnailmode         = thumbnailmode.SelectedValue;
                model.watermarktype         = Utils.StrToInt(watermarktype.SelectedValue, 0);
                model.watermarkposition     = Utils.StrToInt(watermarkposition.Text.Trim(), 9);
                model.watermarkimgquality   = Utils.StrToInt(watermarkimgquality.Text.Trim(), 80);
                model.watermarkpic          = watermarkpic.Text;
                model.watermarktransparency = Utils.StrToInt(watermarktransparency.Text.Trim(), 5);
                model.watermarktext         = watermarktext.Text;
                model.watermarkfont         = watermarkfont.Text;
                model.watermarkfontsize     = Utils.StrToInt(watermarkfontsize.Text.Trim(), 12);

                bll.saveConifg(model);
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改系统配置信息"); //记录日志
                JscriptMsg("修改系统配置成功!", "sys_config.aspx");
            }
            catch
            {
                JscriptMsg("文件写入失败,请检查文件夹权限!", "");
            }
        }
Example #13
0
 public ManagePage()
 {
     this.Load += new EventHandler(ManagePage_Load);
     sysConfig  = new BLL.sysconfig().loadConfig();
 }
Example #14
0
        /// <summary>
        /// 页面请求事件处理
        /// </summary>
        /// <param name="sender">事件的源</param>
        /// <param name="e">包含事件数据的 EventArgs</param>
        private void ReUrl_BeginRequest(object sender, EventArgs e)
        {
            HttpContext context = ((HttpApplication)sender).Context;

            Model.sysconfig siteConfig  = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            string          requestPath = context.Request.Path.ToLower();//获得当前页面(含目录)

            //如果虚拟目录(不含安装目录)与站点根目录名相同则不需要重写
            if (IsDirExist(DTKeys.CACHE_SITE_DIRECTORY, siteConfig.webpath, siteConfig.webpath, requestPath))
            {
                return;
            }

            string requestDomain = context.Request.Url.Authority.ToLower();                     //获得当前域名(含端口号)
            string sitePath      = GetSitePath(siteConfig.webpath, requestPath, requestDomain); //获取当前站点目录
            string requestPage   = CutStringPath(siteConfig.webpath, sitePath, requestPath);    //截取除安装、站点目录部分

            //检查网站重写状态0表示不开启重写、1开启重写、2生成静态
            if (siteConfig.staticstatus == 0)
            {
                #region 站点不开启重写处理方法===========================
                //遍历URL字典,匹配URL页面部分
                foreach (Model.url_rewrite model in SiteUrls.GetUrls().Urls)
                {
                    //查找到与页面部分匹配的节点
                    if (model.page == requestPath.Substring(requestPath.LastIndexOf("/") + 1))
                    {
                        //映射到站点目录下
                        context.RewritePath(string.Format("{0}{1}/{2}{3}",
                                                          siteConfig.webpath, DTKeys.DIRECTORY_REWRITE_ASPX, sitePath, requestPage));
                    }
                }
                #endregion
            }
            else
            {
                #region 站点开启重写或静态处理方法=======================
                //遍历URL字典
                foreach (Model.url_rewrite model in SiteUrls.GetUrls().Urls)
                {
                    //如果没有重写表达式则不需要重写
                    if (model.url_rewrite_items.Count == 0 &&
                        Utils.GetUrlExtension(model.page, siteConfig.staticextension) == requestPath.Substring(requestPath.LastIndexOf("/") + 1))
                    {
                        //映射到站点目录
                        context.RewritePath(string.Format("{0}{1}/{2}/{3}",
                                                          siteConfig.webpath, DTKeys.DIRECTORY_REWRITE_ASPX, sitePath, model.page));
                        return;
                    }
                    //遍历URL字典的子节点
                    foreach (Model.url_rewrite_item item in model.url_rewrite_items)
                    {
                        string newPattern = Utils.GetUrlExtension(item.pattern, siteConfig.staticextension);//替换扩展名

                        //如果与URL节点匹配则重写
                        if (Regex.IsMatch(requestPage, string.Format("^/{0}$", newPattern), RegexOptions.None | RegexOptions.IgnoreCase) ||
                            (model.page == "index.aspx" && Regex.IsMatch(requestPage, string.Format("^/{0}$", item.pattern), RegexOptions.None | RegexOptions.IgnoreCase)))
                        {
                            //如果开启生成静态、是频道页或首页,则映射重写到HTML目录
                            if (siteConfig.staticstatus == 2 && (model.channel.Length > 0 || model.page.ToLower() == "index.aspx")) //频道页
                            {
                                context.RewritePath(siteConfig.webpath + DTKeys.DIRECTORY_REWRITE_HTML + "/" + sitePath +
                                                    Utils.GetUrlExtension(requestPage, siteConfig.staticextension, true));
                                return;
                            }
                            else //其它
                            {
                                string queryString = Regex.Replace(requestPage, string.Format("/{0}", newPattern), item.querystring, RegexOptions.None | RegexOptions.IgnoreCase);
                                context.RewritePath(string.Format("{0}{1}/{2}/{3}",
                                                                  siteConfig.webpath, DTKeys.DIRECTORY_REWRITE_ASPX, sitePath, model.page), string.Empty, queryString);
                                return;
                            }
                        }
                    }
                }
                #endregion
            }
        }
Example #15
0
        /// <summary>
        /// 初始化参数
        /// </summary>
        private void EditorConfig(HttpContext context)
        {
            Model.sysconfig sysConfig = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
            StringBuilder   jsonStr   = new StringBuilder();

            jsonStr.Append("{");
            //上传图片配置项
            jsonStr.Append("\"imageActionName\": \"uploadimage\",");                                     //执行上传图片的action名称
            jsonStr.Append("\"imageFieldName\": \"upfile\",");                                           //提交的图片表单名称
            jsonStr.Append("\"imageMaxSize\": " + (sysConfig.imgsize * 1024) + ",");                     //上传大小限制,单位B
            jsonStr.Append("\"imageAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"],"); //上传图片格式显示
            jsonStr.Append("\"imageCompressEnable\": false,");                                           //是否压缩图片,默认是true
            jsonStr.Append("\"imageCompressBorder\": 1600,");                                            //图片压缩最长边限制
            jsonStr.Append("\"imageInsertAlign\": \"none\",");                                           //插入的图片浮动方式
            jsonStr.Append("\"imageUrlPrefix\": \"\",");                                                 //图片访问路径前缀
            jsonStr.Append("\"imagePathFormat\": \"\",");                                                //上传保存路径
            //涂鸦图片上传配置项
            jsonStr.Append("\"scrawlActionName\": \"uploadscrawl\",");                                   //执行上传涂鸦的action名称
            jsonStr.Append("\"scrawlFieldName\": \"upfile\",");                                          //提交的图片表单名称
            jsonStr.Append("\"scrawlPathFormat\": \"\",");                                               //上传保存路径
            jsonStr.Append("\"scrawlMaxSize\": " + (sysConfig.imgsize * 1024) + ",");                    //上传大小限制,单位B
            jsonStr.Append("\"scrawlUrlPrefix\": \"\",");                                                //图片访问路径前缀
            jsonStr.Append("\"scrawlInsertAlign\": \"none\",");
            //截图工具上传
            jsonStr.Append("\"snapscreenActionName\": \"uploadimage\","); //执行上传截图的action名称
            jsonStr.Append("\"snapscreenPathFormat\": \"\",");            //上传保存路径
            jsonStr.Append("\"snapscreenUrlPrefix\": \"\",");             //图片访问路径前缀
            jsonStr.Append("\"snapscreenInsertAlign\": \"none\",");       //插入的图片浮动方式
            //抓取远程图片配置
            jsonStr.Append("\"catcherLocalDomain\": [\"127.0.0.1\", \"localhost\", \"img.baidu.com\"],");
            jsonStr.Append("\"catcherActionName\": \"catchimage\",");                                      //执行抓取远程图片的action名称
            jsonStr.Append("\"catcherFieldName\": \"source\",");                                           //提交的图片列表表单名称
            jsonStr.Append("\"catcherPathFormat\": \"\",");                                                //上传保存路径
            jsonStr.Append("\"catcherUrlPrefix\": \"\",");                                                 //图片访问路径前缀
            jsonStr.Append("\"catcherMaxSize\": " + (sysConfig.imgsize * 1024) + ",");                     //上传大小限制,单位B
            jsonStr.Append("\"catcherAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"],"); //抓取图片格式显示
            //上传视频配置
            jsonStr.Append("\"videoActionName\": \"uploadvideo\",");                                       //上传视频的action名称
            jsonStr.Append("\"videoFieldName\": \"upfile\",");                                             //提交的视频表单名称
            jsonStr.Append("\"videoPathFormat\": \"\",");                                                  //上传保存路径
            jsonStr.Append("\"videoUrlPrefix\": \"\",");                                                   //视频访问路径前缀
            jsonStr.Append("\"videoMaxSize\": " + (sysConfig.videosize * 1024) + ",");                     //上传大小限制,单位B
            jsonStr.Append("\"videoAllowFiles\": " + GetExtension(sysConfig.videoextension) + ",");
            //上传附件配置
            jsonStr.Append("\"fileActionName\": \"uploadfile\",");                                              //上传视频的action名称
            jsonStr.Append("\"fileFieldName\": \"upfile\",");                                                   //提交的文件表单名称
            jsonStr.Append("\"filePathFormat\": \"\",");                                                        //上传保存路径
            jsonStr.Append("\"fileUrlPrefix\": \"\",");                                                         //文件访问路径前缀
            jsonStr.Append("\"fileMaxSize\": " + (sysConfig.attachsize * 1024) + ",");                          //上传大小限制,单位B
            jsonStr.Append("\"fileAllowFiles\": " + GetExtension(sysConfig.fileextension) + ",");               //上传文件格式
            //列出指定目录下的图片
            jsonStr.Append("\"imageManagerActionName\": \"listimage\",");                                       //执行图片管理的action名称
            jsonStr.Append("\"imageManagerListPath\": \"\",");                                                  //指定要列出图片的目录
            jsonStr.Append("\"imageManagerListSize\": 20,");                                                    //每次列出文件数量
            jsonStr.Append("\"imageManagerUrlPrefix\": \"\",");                                                 //图片访问路径前缀
            jsonStr.Append("\"imageManagerInsertAlign\": \"none\",");                                           //插入的图片浮动方式
            jsonStr.Append("\"imageManagerAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"],"); //列出的文件类型
            //列出指定目录下的文件
            jsonStr.Append("\"fileManagerActionName\": \"listfile\",");                                         //执行文件管理的action名称
            jsonStr.Append("\"fileManagerListPath\": \"\",");                                                   //指定要列出文件的目录
            jsonStr.Append("\"fileManagerUrlPrefix\": \"\",");                                                  //文件访问路径前缀
            jsonStr.Append("\"fileManagerListSize\": 20,");                                                     //每次列出文件数量
            jsonStr.Append("\"fileManagerAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\",");
            jsonStr.Append("\".flv\", \".swf\", \".mkv\", \".avi\", \".rm\", \".rmvb\", \".mpeg\", \".mpg\",");
            jsonStr.Append("\".ogg\", \".ogv\", \".mov\", \".wmv\", \".mp4\", \".webm\", \".mp3\", \".wav\", \".mid\",");
            jsonStr.Append("\".rar\", \".zip\", \".tar\", \".gz\", \".7z\", \".bz2\", \".cab\", \".iso\",");
            jsonStr.Append("\".doc\", \".docx\", \".xls\", \".xlsx\", \".ppt\", \".pptx\", \".pdf\", \".txt\", \".md\", \".xml\"]");
            jsonStr.Append("}");

            context.Response.AddHeader("Content-Type", "text/plain; charset=UTF-8");
            context.Response.Write(jsonStr.ToString());
            context.Response.End();
        }
Example #16
0
 public ManagePage()
 {
     this.Load += new EventHandler(ManagePage_Load);
     sysConfig  = YTS.SystemService.GlobalSystemService.GetInstance().Config.Get <Model.sysconfig>();
 }