Learning to use IHTTPHANDLER Question: Prevent all files from encry directory from illegally downloading solutions: 1 All files, and give control to our own IHTTPHANDLER2, implement: 2. Add application mapping: Open IIS Manager -> Right-click We want to control the downloaded site -> in the Properties dialog box "Configure ..." Change the files in the red circle to your own .Netframework aspnet_isapi.dll path 2.2 Modify Web.config Add httphandlers items under System.Web ... add> httphandlers> ... 2.3 implementation ittphandler // ----------- ------------- File: Class1.cs --------- Using System; Using System.Web; Namespace Customhttphandler {/// /// Class1 Summary Description. /// summary> public class class 1: system.Web.ihttphandler {public class1 () {// // Todo: Add constructor logic //} #Region Ihttphandler member public void processRequest (httpContext context) { // Todo: Add class1.processRequest implementation // string strrefurl = context.request.serverVariables ["http_refer"]; / * Insert your own code, read the contents of the file and populate the response, this example is only simply returns an error message * / Context.Response.write ("You cannot access this page");} public bool isreusable {get {// Todo: Add class1.isreusable getter implementation return false;}} #ENDREGON}} // ------- ---------- File: End ------------------------------------- -----------