⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;

namespace NetCMS.Web
{
    public partial class _default : NetCMS.Web.UI.BasePage
    {
        protected string SiteRootPath = NetCMS.Common.ServerInfo.GetRootPath();
        protected string dimm = NetCMS.Config.UIConfig.dirDumm;
        protected string TempletDir = NetCMS.Config.UIConfig.dirTemplet;
        public static string gInstallDir = "{$InstallDir}";
        public static string gTempletDir = "{$TempletDir}";
        protected void Page_Load(object sender, EventArgs e)
        {
            string gChID = Request.QueryString["ChID"];
            int ChID = 0;
            if (gChID != null && gChID != string.Empty)
            {
                if (NetCMS.Common.Input.IsInteger(gChID.ToString()))
                {
                    ChID = int.Parse(gChID.ToString());
                }
            }
            NetCMS.Publish.CommonData.Initialize();
            string indexname = "index.html";
            string TempletPath = NetCMS.Common.Public.readparamConfig("IndexTemplet");
            if (ChID != 0)
            {
                TempletPath = "/" + NetCMS.Config.UIConfig.dirTemplet + "/" + NetCMS.Common.Public.readCHparamConfig("channeltemplet", ChID);
            }
            TempletPath = TempletPath.Replace("/", "\\");
            TempletPath = TempletPath.ToLower().Replace("{@dirtemplet}", TempletDir);
            indexname = NetCMS.Common.Public.readparamConfig("IndexFileName");
            NetCMS.Publish.Template indexTemp = null;
            if (ChID != 0)
            {
                indexname = NetCMS.Common.Public.readCHparamConfig("channelindexname", ChID);
                indexTemp = new NetCMS.Publish.Template(SiteRootPath.Trim('\\') + TempletPath, NetCMS.Publish.TempType.ChIndex);
            }
            else
            {
                indexTemp = new NetCMS.Publish.Template(SiteRootPath.Trim('\\') + TempletPath, NetCMS.Publish.TempType.Index);
            }
            indexTemp.GetHTML();
            indexTemp.ReplaceLabels();
            indexTemp.ReplaceIMLabels();
            string getContent = indexTemp.FinallyContent;

            if (Regex.Match(getContent, @"\</head\>[\s\S]*\<body", RegexOptions.IgnoreCase | RegexOptions.Compiled).Success)
            {
                getContent = Regex.Replace(getContent, "<body", getjs() + "<body", RegexOptions.IgnoreCase | RegexOptions.Compiled);
            }
            else
            {
                getContent = getjs() + getContent;
            }
            getContent = (getContent.Replace(gInstallDir, NetCMS.Publish.CommonData.getUrl())).Replace(gTempletDir, TempletDir);
            Response.Write(getContent);
        }

        protected string getjs()
        {
            string getajaxJS = "<script language=\"javascript\" type=\"text/javascript\" src=\"" + NetCMS.Publish.CommonData.getUrl() + "/configuration/js/Prototype.js\"></script>\r\n";
            getajaxJS += "<script language=\"javascript\" type=\"text/javascript\" src=\"" + NetCMS.Publish.CommonData.getUrl() + "/configuration/js/jspublic.js\"></script>\r\n";
            getajaxJS += "<!--Created by NETCMS v1.0 For Netcms Inc. at " + DateTime.Now + "-->\r\n";
            return getajaxJS;
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -