Esempio n. 1
0
        /// <summary>
        /// 获取模型数据-文件路径-目标
        /// </summary>
        /// <returns>文件绝对路径</returns>
        public string GetFilePath_Target(Model.URLReWriter model)
        {
            if (CheckData.IsObjectNull(model))
            {
                return(string.Empty);
            }
            // 需要指定生成路径文件夹目录
            Model.URLReWriterConfig curl = GlobalSystemService.GetInstance().Config.Get <Model.URLReWriterConfig>();
            string directory             = this.SelfDAL.GetSiteNamePathFolder(curl.RootPage);
            string path = PathHelp.CreateUseFilePath(directory, model.Target);

            return(path);
        }
Esempio n. 2
0
        /// <summary>
        /// HTTP 重定向路径
        /// </summary>
        /// <param name="uri">需要的原始路径各部分信息</param>
        /// <param name="urlmodel">需要的 URL 重定向模型</param>
        /// <returns>最终生成的重定向路径</returns>
        public string HTTPRedirectPath(Uri uri, Model.URLReWriter urlmodel)
        {
            if (CheckData.IsObjectNull(urlmodel))
            {
                return(string.Empty);
            }
            Model.URLReWriterConfig curl = GlobalSystemService.GetInstance().Config.Get <Model.URLReWriterConfig>();
            string directory             = this.SelfDAL.GetSiteNamePathFolder(curl.RootPage);

            Model.URLReWriter.RegularQuery rq = urlmodel.ReItems[0];
            if (CheckData.IsObjectNull(uri))
            {
                return(string.Format("{0}/{1}", directory, urlmodel.Target));
            }
            string querystr = Regex.Replace(uri.AbsolutePath, rq.Pattern, rq.QueryParameter);

            if (!CheckData.IsStringNull(uri.Query))
            {
                querystr = string.Format("{0}&{1}", querystr, uri.Query.TrimStart('?'));
            }
            string path = string.Format("{0}/{1}?{2}", directory, urlmodel.Target, querystr);

            return(path);
        }
Esempio n. 3
0
 public string GetRootTemplatePathFolder()
 {
     Model.URLReWriterConfig curl = GlobalSystemService.GetInstance().Config.Get <Model.URLReWriterConfig>();
     return(string.Format("/{0}", PathHelp.ToPathSymbol(curl.RootTemplate)));
 }
Esempio n. 4
0
 /// <summary>
 /// 重写: 获取 URL 重写路径配置文件文件夹路径
 /// </summary>
 public override string GetPathFolder()
 {
     Model.URLReWriterConfig curl = GlobalSystemService.GetInstance().Config.Get <Model.URLReWriterConfig>();
     return(GetSiteNamePathFolder(PathHelp.ToPathSymbol(curl.RootTemplate)));
 }