Can I deny ASP.NET anonymous access to all files?
My hypothetical website doesn't allow anonymous access and uses Forms Authentication. So the initial request for www.example.com/SomePage.aspx is redirected to www.example.com/Login.aspx?ReturnUrl=SomePage.aspx.
However users can still access URLs that aren't served by ASP.NET, eg: www.example.com/Images/AnImage.jpg or www.example.com/TextFile.txt.
Is it possible to deny anonymous access to these files and use the same Forms Authentication?
You can use IIS Extention Mapping. For More information click IIS Extention Mapping
Yes - You must register ASP.NET for every file (.*) extension. this you have to configurate in ISS.
链接地址: http://www.djcxy.com/p/55846.html上一篇: 上传Excel文件时访问路径被拒绝