Web/kzcms/core/_Article.aspx.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Linq;
using System.IO;
using Kscor.TemplateEngine;

namespace Web.core
{
    public partial class _Article : System.Web.UI.Page
    {
        private VelocityHelper vh = null;
        private string templatePath = "", themeurl = "";
        private Kscor.Model.Config ModelConfig = new Kscor.BLL.Config().GetMaxModel();

        int ArticleID = 0;
        string Articlename = "";
        private Kscor.Model.Channel ModelChannel = null;
        private Kscor.BLL.Channel BLLChannel = new Kscor.BLL.Channel();
        private Kscor.Model.Article ModelArticle = null;
        private Kscor.BLL.Article BLLArticle = new Kscor.BLL.Article();

        protected void Page_Load(object sender, EventArgs e)
        {
            string CookieTheme = Kscor.Common.CookieHelper.GetCookieValue("Theme");
            if (ModelConfig == null)
            {
                Response.Write("系统配置出错");
            }
            else
            {
                string MyTheme = CookieTheme == "" ? ModelConfig.Theme : CookieTheme;
                themeurl = string.Format("/kzcms/themes/{0}/", MyTheme);
                templatePath = Server.MapPath(themeurl);
                if (!Directory.Exists(templatePath))
                {
                    Response.Write(string.Format("主题{0}不存在!", MyTheme));
                }
                else
                {
                    vh = new VelocityHelper(templatePath);
                    vh.themeurl = themeurl;
                    vh.ModelConfig = ModelConfig;
                    vh.LoadCommon();
                    LoadArticle();
                }
            }
        }


        private void LoadArticle()
        {
            ArticleID = RouteData.Values["ArticleID"] == null ? 0 : Convert.ToInt32(RouteData.Values["ArticleID"]);
            Articlename = RouteData.Values["Articlename"] == null ? "" : RouteData.Values["Articlename"].ToString();
            ArticleID = ArticleID == 0 ? Kscor.Common.DNTRequest.GetInt("ArticleID", 0) : ArticleID;
            Articlename = Articlename == "" ? Kscor.Common.DNTRequest.GetString("Articlename") : Articlename;

            ModelArticle = BLLArticle.GetList(p => p.ID == ArticleID && p.State == 0).FirstOrDefault();
            if (ModelArticle != null)
            {
                if (Articlename != "")
                {
后面还有 59 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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