如何防止在Asp.Net中索引特定目录的文件 [英] how to prevent from indexing file of specific Directory in Asp.Net
本文介绍了如何防止在Asp.Net中索引特定目录的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨所有
在htaccess我们能够阻止目录的索引文件
选项-Indexes
但我需要asp.Net
htaccess文件在php中使用但我需要在Asp.Net
非常感谢
hi all
in htaccess we able to prevent from Indexing file of Directory
Options -Indexes
but i need for asp.Net
htaccess file use in php but i need in Asp.Net
Thanks so Much
推荐答案
你可以在你的网络配置文件中设置这个,查看下面的示例网络配置
you can set this on your web config file, check below sample web config
<configuration>
<system.webserver>
<directorybrowse enabled="false" />
</system.webserver>
</configuration>
if you want要启用目录浏览,将directoryBrowse设置为true,如果您在IIS中托管Web应用程序,则可以按照以下步骤进行操作
http://technet.microsoft.com/en-us/library/cc731109(v = ws.10).aspx [ ^ ]
这篇关于如何防止在Asp.Net中索引特定目录的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文