Esempio n. 1
0
        /// <summary>
        /// 创建首页
        /// </summary>
        /// <param name="Path">创建路径</param>
        /// <returns></returns>
        public void CreateDefault()
        {
            //   int pid = nll.GetContrarily(DataConverter.CLng(this.Nodeist), 5);
            M_Node      Pnid = nll.SelReturnModel(DataConverter.CLng(this.Nodeist));
            XmlDocument xml  = new XmlDocument();

            xml.LoadXml(Pnid.SiteConfige);
            XmlNodeList xnl = xml.SelectNodes("SiteConfig");

            dir = function.GetXmlNode(xnl, "TemplateDir");
            dir = dir.Substring(1, dir.LastIndexOf("Template") - 1);
            string dir1 = dir;

            dir = dir.Replace(@"\", "/");
            dir = dir.Replace("//", "/");
            dir = "/" + dir;

            string Siteulr = SiteConfig.SiteInfo.SiteUrl + dir + "Default.aspx";

            string DefaultContent = remo.GetRemoteHtmlCode(Siteulr);//获得首页内容

            #region 路径机制替换
            DefaultContent = GetDefaultfunction(DefaultContent);               //提取内容替换链接
            #endregion
            remo.SaveContent(DefaultContent, SiteMapath + dir1 + "index.htm"); //保存文件
        }
Esempio n. 2
0
        /// <summary>
        /// 生成栏目页静态文件
        /// </summary>
        /// <param name="Noidlist">节点列表文件 逗号隔开</param>
        /// <param name="CreateParentID">是否生成子节点</param>
        /// <returns></returns>
        public bool CreateListFile(int nodeid)
        {
            XmlDocument xml = new XmlDocument();
            XmlNodeList xnl;

            if (nodeid > 0)
            {
                int    pid  = nll.SelFirstNodeID(nodeid);
                M_Node Pnid = nll.SelReturnModel(pid);
                if (!string.IsNullOrEmpty(Pnid.SiteConfige))
                {
                    xml.LoadXml(Pnid.SiteConfige);
                    xnl = xml.SelectNodes("SiteConfig");
                    dir = function.GetXmlNode(xnl, "TemplateDir");
                    dir = dir.Substring(1, dir.LastIndexOf("Template") - 1);
                    dir = dir.Replace(@"\", "/");
                    dir = dir.Replace("//", "/");
                    dir = "/" + dir;
                    DataTable ntable = nll.SelByIDS(this.Nodeist);//生成静态的节点
                    if (ntable != null && ntable.Rows.Count > 0)
                    {
                        SetCreateList(ntable);
                    }
                }
            }
            return(false);
        }
Esempio n. 3
0
        public bool CreateHtml(int nodeid)
        {
            M_Node Pnid = new M_Node();

            if (nodeid > 0)
            {
                int pid = nll.SelFirstNodeID(nodeid);
                Pnid = nll.SelReturnModel(pid);
                XmlDocument xml = new XmlDocument();
                xml.LoadXml(Pnid.SiteConfige);
                XmlNodeList xnl = xml.SelectNodes("SiteConfig");
                templateDir = function.GetXmlNode(xnl, "TemplateDir");
                templateDir = templateDir.Substring(1, templateDir.LastIndexOf("Template") - 1);
                templateDir = templateDir.Replace(@"\", "/");
                templateDir = templateDir.Replace("//", "/");
            }

            if (nll.SelByIDS(this.Nodeist).Rows.Count > 0)
            {
                DataTable ntable = nll.SelByIDS(this.Nodeist);
                for (int i = 0; i < ntable.Rows.Count; i++)
                {
                    string    NodeID     = ntable.Rows[i]["NodeID"].ToString();
                    DataTable GetContent = cll.GetNodeAri(DataConverter.CLng(NodeID));//ZL_CommonModel nodeid

                    for (int b = 0; b < GetContent.Rows.Count; b++)
                    {
                        int GeneralID = DataConverter.CLng(GetContent.Rows[b]["GeneralID"].ToString());

                        SetCreateContent(DataConverter.CLng(NodeID), GeneralID);
                    }
                }
            }

            return(false);
        }