简体   繁体   English

如何在应用程序内部访问网页层次结构

[英]How to access web page hierarchy inside a application

Trying to figure out how to programmatically access the web pages in the application. 试图弄清楚如何以编程方式访问应用程序中的网页。 Just something simple like a list of them would be awesome. 像清单这样简单的东西就很棒。 I know I can create a list but I was wondering if there was something that could 'look' at the pages and add a new one to the list if you make a new page for the application. 我知道我可以创建一个列表,但是我想知道是否有可以“查看”页面的东西,如果为应用程序创建新页面,可以在列表中添加新的东西。

Example with 7 pages: 7页示例:

 Error
 Default
 Login
 Content
 Users
 ContactUs
 Admin

I am half awake so I may be a little unclear. 我半醒着,所以可能不清楚。 Maybe puting it all in a single question will be easier. 也许将所有问题放在一个问题中会更容易。

How do you autogenerate a list of all webpages in your current application? 您如何在当前应用程序中自动生成所有网页的列表?

In a traditional ASP.Net application, you can simply find all of the .aspx files, like this: 在传统的ASP.Net应用程序中,您可以简单地找到所有.aspx文件,如下所示:

Directory.GetFiles(Server.MapPath("~/"), "*.aspx", SearchOption.AllDirectories)

Note that this will return full filepaths; 注意,这将返回完整的文件路径。 you can call Path.GetFileNameWithoutExtension to get the names. 您可以调用Path.GetFileNameWithoutExtension来获取名称。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何启用对Web服务中的应用程序变量的访问 - How do I enable access to Application variables inside a web service 如何从aspx页面访问userControl内部的Web控件 - how to access a web control inside a userControl from aspx page 如何订购角色层次结构以访问 MVC5 中的授权页面? - How to order Roles hierarchy to access Authorized page in MVC5? 如果Web应用程序具有嵌套的母版页,如何从另一个用户控件动态访问母版页上的控件 - How to access controls on a master page dynamically from another user control, if the web application has nested master page 如何访问放置在ASP.NET Web应用程序内部通用文件夹中的文件 - How to access a file placed in a generic Folder inside of an ASP.NET Web Application 如何访问后端类库项目中客户端应用程序的Web配置文件中存储的连接字符串 - How to access connection string stored in web config file of client application inside back end class library project 如何在线程(ASP.NET Web窗体)中访问页面控件(标签,计时器等) - How access page controls (label, timer, etc) inside a thread (ASP.NET Web Forms) 如何将来自C#程序中Web浏览器小程序中加载的网页的参数传递回C#应用程序? - How can I pass an argument from a web page that is loaded inside a web browser applet in a C# program, back to the C# application? 在我们的Web应用程序中打开一个保护外部页面 - Opening an protect external page inside our web application 如何使用服务应用程序从Web应用程序访问客户端应用程序 - How to access client application from web application with service application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM