ActionLabel/BasePage.cs

(完整代码) 1KB

using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Configuration;
using Common;

namespace ActionLabel
{
    public partial class BasePage : System.Web.UI.Page
    {
        public BasePage()
        {
            
        }

        /// <summary>
        /// 返回伪静态统一链接地址
        /// </summary>
        public static string URLRewrite(string _key, params object[] _params)
        {
            Model.WebSet SiteConfig = new BLL.WebSet().loadConfig(Utils.GetXmlMapPath("Configpath"));
            Hashtable _siteurls = new BLL.SiteUrl().loadConfig(Utils.GetXmlMapPath("Urlspath"));
            Model.SiteUrl model = _siteurls[_key] as Model.SiteUrl;
            if (model == null)
            {
                return "";
            }
            try
            {
                string _rewriteurl = string.Format(model.Path, _params);
                int count = SiteConfig.ArticlePageNum_Client;
                //if (SiteConfig.IsUrlRewrite == 1)
                //{
                //    return SiteConfig.WebPath.TrimEnd('/') + _rewriteurl;
                //}
                string _originalurl = model.Page;
                if (!string.IsNullOrEmpty(model.QueryString))
                {
                    _originalurl = model.Page + "?" + Regex.Replace(_rewriteurl, model.Pattern, model.QueryString, RegexOptions.None | RegexOptions.IgnoreCase);
                }
                return SiteConfig.WebPath.TrimEnd('/') + _originalurl;
             

            }
            catch
            {
                return "";
            }
        }

    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。