Web/Footer.ascx.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using System.Collections;
using System.Text.RegularExpressions;
namespace Web.Aspx
{
    public partial class Footer : System.Web.UI.UserControl
    {
        public Model.WebSet SiteConfig =new Model.WebSet();
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteConfig = new BLL.WebSet().loadConfig(Utils.GetXmlMapPath("Configpath"));
        }
        /// <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 算力,解读结果公开显示在下面。

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