C# web.config-拒绝访问特定文件夹和内容
目标是: 拒绝匿名用户访问特定文件夹及其web.config文件中的内容 问题 在该文件夹中,我们有一些文件夹,每个文件夹中都有html文件, 例如: 演示/beta1/index.html 演示/beta2/index.html 如果我们在浏览器上引入以下URL Demos/beta1/index.html,那么创作对匿名用户不起作用。为什么C# web.config-拒绝访问特定文件夹和内容,c#,asp.net-mvc,web-config,C#,Asp.net Mvc,Web Config,目标是: 拒绝匿名用户访问特定文件夹及其web.config文件中的内容 问题 在该文件夹中,我们有一些文件夹,每个文件夹中都有html文件, 例如: 演示/beta1/index.html 演示/beta2/index.html 如果我们在浏览器上引入以下URL Demos/beta1/index.html,那么创作对匿名用户不起作用。为什么 <?xml version="1.0"?> <configuration> <location path="Demos
<?xml version="1.0"?>
<configuration>
<location path="Demos" allowOverride="true">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
</configuration>
你有没有删除过匿名标识?没有,最有趣的是,它与其他URL(如Demos/Beta1)一起工作。那么可能是位置路径的问题……位置路径是什么意思?演示文件夹位于Content文件夹中,web.config也位于Content文件夹中。请尝试删除path属性,然后检查,我不确定该部分。。。