------- Windows Phone 7 Mobile Phone development,. Net training, and we look forward to communicating with you! -------
In the learning process, I learned to use ASP. net anti-Leech, but I tried it, this anti-leech can only prevent the same use of ASP.. For reference only
Can I use a class to inherit ihttpmodule or ihandler? The ihandler in my program is occupied, so I use ihttpmodule.
Configuration file:
Code:
Using system; using system. collections. generic; using system. LINQ; using system. web; // <summary> /// MDO abstract description /// </Summary> public class httpmodule: ihttpmodule {public void Init (httpapplication context) {context. beginrequest + = new eventhandler (context_beginrequest);} void context_beginrequest (Object sender, eventargs e) {// obtain the current object httpapplication context = sender as httpapplication; If (context. request. urlreferrer = NULL) {} else {// determine whether the visitor is our own if (context. request. urlreferrer. host = "localhost" & context. request. urlreferrer. port = context. request. URL. port) {// if it is not processed, let it run normally} else // if it is a foreign personnel, do processing {// If the access type is image context. response. contenttype = "image/jpg"; // you can specify an incorrect image context. response. writefile (context. request. physicalapplicationpath + "admin/bookcovers/1323.jpg") ;}} public void dispose (){}}
------- Windows Phone 7 Mobile Phone development,. Net training, and we look forward to communicating with you! -------