I want to restrict my web app so that .ini files can not be downloaded/shown. Is this something I can set up in my web.config file?
EDIT based on answer:
I tried this in my config file:
<system.web>
<httpHandlers>
<add verb="*" path="*.txt" type="System.Web.HttpForbiddenHandler" />
</httpHandlers>
</system.web>
...but it had no effect. I am using IIS7 and application is .NET3.5, could this have something to do with it? I know this would actually work for .NEt 1.0 1.1 and 2.0.
I noticed in the documentation for this (add httpHandlers), the Requirements section:
Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0
The .NET Framework version 1.0, 1.1, or 2.0
Microsoft Visual Studio 2003 or Visual Studio 2005
...which indicates that this is not supported in .NET 3 and IIS7...
Where is this specified in IIS7?