首页 > Linux操作系统 > Linux操作系统 > <location> 元素
指定需要应用特定的配置设置的资源。
配置结构的示例:
path="path"
allowoverride="true|false" />
| 属性 | 选项 | 描述 |
|---|---|---|
| path | 需要应用特定的配置设置的资源。如果使用 | |
| allowOverride | 指定配置设置是否可以由子目录中的 Web.config 文件覆盖。 | |
| true | 指定可以覆盖配置设置。默认值是 true。 | |
| false | 指定不能覆盖配置设置。 |
下例允许匿名用户访问 Logon.aspx 页。
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><configuration>
<location path="Logon.aspx">
<system.web>
<authorization>
<allow users="?"/>
authorization>
system.web>
location>
configuration>
下例只将指定页面的上载文件大小限制设置为 128KB。
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><configuration>
<location path="UploadPage.aspx">
<httpRuntime maxRequestLength="128"/>
location>
configuration>
下例不允许子目录中的 Web.config 文件更改配置设置。
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
--><configuration>
<location allowOverride="false"/>
configuration>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-617608/ ,如需转载,请注明出处,否则将追究法律责任。