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

📄 siteothercreate.aspx.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
    using PowerEasy.Common;
    using PowerEasy.Components;
    using PowerEasy.Controls;
    using PowerEasy.Model.TemplateProc;
    using PowerEasy.Templates;
    using PowerEasy.Web.UI;
    using System;
    using System.Web;
    using System.Web.UI.WebControls;

    public class SiteOtherCreate : AdminPage
    {
        protected Button BtnBaidu;
        protected Button BtnGoogle;
        protected Button BtnRss;
        protected HyperLink HypBaidMap;
        protected HyperLink HypGoogleMap;
        protected Panel PanelForm;
        protected Panel PanelMsg;
        protected ExtendedSiteMapPath SmpNavigator;

        protected void BtnBaidu_Click(object sender, EventArgs e)
        {
            TemplateInfo templateInfo = new TemplateInfo();
            templateInfo.QueryList = base.Request.QueryString;
            string path = "/其他模板/BaiDu地图模板.html";
            templateInfo.PageName = "BaiduSiteMap_Index.xml";
            templateInfo.IsDynamicPage = false;
            templateInfo.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1);
            templateInfo.RootPath = base.Request.PhysicalApplicationPath;
            templateInfo.SiteUrl = SiteConfig.SiteInfo.SiteUrl;
            templateInfo.TemplateContent = Template.GetTemplateContent(path);
            TemplateTransform.GetHtml(templateInfo);
            FileSystemObject.WriteFile(VirtualPathUtility.AppendTrailingSlash(templateInfo.RootPath) + SiteConfig.SiteOption.CreateHtmlPath + templateInfo.PageName, TemplateTransform.GetHtml(templateInfo).TemplateContent);
            this.HypBaidMap.Visible = true;
            this.HypBaidMap.Text = "生成成功,点击提交地图!";
            this.HypBaidMap.NavigateUrl = "http://news.baidu.com/newsop.html";
        }

        protected void BtnGoogle_Click(object sender, EventArgs e)
        {
            TemplateInfo templateInfo = new TemplateInfo();
            templateInfo.QueryList = base.Request.QueryString;
            string path = "/其他模板/Google地图模板.html";
            templateInfo.PageName = "GoogleSiteMap_Index.xml";
            templateInfo.IsDynamicPage = false;
            templateInfo.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1);
            templateInfo.RootPath = base.Request.PhysicalApplicationPath;
            templateInfo.SiteUrl = SiteConfig.SiteInfo.SiteUrl;
            templateInfo.TemplateContent = Template.GetTemplateContent(path);
            TemplateTransform.GetHtml(templateInfo);
            FileSystemObject.WriteFile(VirtualPathUtility.AppendTrailingSlash(templateInfo.RootPath) + SiteConfig.SiteOption.CreateHtmlPath + templateInfo.PageName, TemplateTransform.GetHtml(templateInfo).TemplateContent);
            this.HypGoogleMap.Visible = true;
            this.HypGoogleMap.Text = "生成成功,点击提交地图!";
            this.HypGoogleMap.NavigateUrl = "http://www.google.com/webmasters/sitemaps/ping?sitemap=" + templateInfo.SiteUrl + "/" + templateInfo.PageName;
        }

        protected void BtnRss_Click(object sender, EventArgs e)
        {
            TemplateInfo templateInfo = new TemplateInfo();
            templateInfo.QueryList = base.Request.QueryString;
            string path = string.Empty;
            foreach (FrontTemplate template in SiteConfig.FrontTemplateList)
            {
                if (string.Compare("RssIndex", template.Key, true) == 0)
                {
                    path = template.Value;
                    break;
                }
            }
            templateInfo.PageName = "Rss.xml";
            templateInfo.CurrentPage = 1;
            templateInfo.RootPath = base.Request.PhysicalApplicationPath;
            templateInfo.SiteUrl = SiteConfig.SiteInfo.SiteUrl;
            templateInfo.IsDynamicPage = false;
            templateInfo.TemplateContent = Template.GetTemplateContent(path, base.Request.PhysicalApplicationPath);
            TemplateTransform.GetHtml(templateInfo);
            FileSystemObject.WriteFile(VirtualPathUtility.AppendTrailingSlash(base.Request.PhysicalApplicationPath) + SiteConfig.SiteOption.CreateHtmlPath + "Rss/Rss.xml", TemplateTransform.GetHtml(templateInfo).TemplateContent);
            AdminPage.WriteSuccessMsg("生成成功!");
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                this.BtnRss.Enabled = SiteConfig.SiteOption.RssEnable;
                this.PanelForm.Visible = true;
                this.PanelMsg.Visible = false;
            }
        }
    }
}

⌨️ 快捷键说明

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