Click here to Skip to main content
15,881,757 members
Articles / Web Development / ASP.NET

Protect Files and Folders Using HttpHandlers in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.88/5 (33 votes)
9 May 2011CPOL5 min read 154K   2.7K   111  
A quick walkthrough showing how to protect files and folders using HttpHandlers, in VB.NET and C#.
<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
      <httpHandlers>
        <add verb="*" path="*" validate="true" type="FileProtectionHandler"/>
      </httpHandlers>
    </system.web>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United Kingdom United Kingdom
I am a self-taught programmer originating from the Isle of Wight. I have approximately 3 years commercial experience in developing LOB applications for a wide range of customers (local companies to FTSE 100). During this time, I have honed my development skills across a wide range of platforms and frameworks including C#, VB.net, T-SQL, Web Services and Android programming.

I am currently training towards my MCSA SQL Server 2012 qualification alongside my degree in Computing from Bournemouth University (Graduating 2013). During my time at Bournemouth University, I have built an extensive knowledge in core networking protocols and architecture including TCP, IP (v4 & v6), DNS, ARP, HTTP, EMAIL (SMTP, POP3 and IMAP), WiMAX (802.16) and WiFi (802.11).

I like to help fellow developers through the StackExchange network, accumulating approximately 3000 reputation across the various sites. I also like to maintain a technology blog to help others learn.

Comments and Discussions