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

📄 sitemapapi.aspx.cs

📁 《圣殿祭司的ASP.NET 2.0开发详解——使用C#》光盘内容.包含了书籍所含的源代码.非常经典的一本asp.net2.0的书籍
💻 CS
字号:
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;

public partial class SiteMapAPI : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		//显示根节点的Url与Title
		Response.Write("<OL>");
		Response.Write("<li>根节点路径为:" + SiteMap.RootNode.Url + "</li>");
		Response.Write("<li>根节点Title为:" + SiteMap.RootNode.Title + "</li>");
		Response.Write("<li>根节点Provider为:" + SiteMap.RootNode.Provider.Name + "</li>");

		//检测显示根节点下面是否还含有子节点
		if (SiteMap.RootNode.HasChildNodes)
		{
			Response.Write("<li>根节点是否还包含子节点:" + SiteMap.RootNode.HasChildNodes+"</li></OL>");
			//通过列举取得其下节点
			IEnumerator rootNodesChildrenEnumerator = SiteMap.RootNode.ChildNodes.GetEnumerator();
			Response.Write("根节点下的父节点为:");
			while (rootNodesChildrenEnumerator.MoveNext())
			{
				//显示子节点
				Response.Write("<pre>  +--" + rootNodesChildrenEnumerator.Current.ToString() + "</pre>");
			}
		}
    }
}

⌨️ 快捷键说明

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