ASP. net http module and processing program (1)

Source: Internet
Author: User
Introduction

At the beginning of the internetera, customers' needs can be met by a limited number of. HTM files. However, as the time passes, the expansion required by the customer exceeds the functions contained in the .htm file or static file.

Developers need to expand or expand the functions of web servers. Web server vendors have designed different solutions, but all follow the same topic "insert certain components to Web servers ". All complementary web server technologies allow developers to establish and insert components to Enhance web server functionality. Microsoft proposed ISAPI (Internet Server API), and Netscape proposed nsapi (webscape Server API.

ISAPI is an important technology that allows us to enhance the capabilities of ISAPI-compatible Web servers (IIS is a web server compatible with ISAPI. We use the following components to achieve this goal:

· ISAPI extension

· ISAPI filter

ISAPI extensions are implemented using Win32 dynamic link libraries. You can regard ISAPI extension as a common application. Program . The objective of ISAPI scaling is to handle HTTP requests. This means you must call them to activate them. You can think that the ISAPI filter is just a filter. Each time the client sends a request to the server, the request goes through a filter. The client does not need to specify a filter in the request, but simply sends the request to the Web server. Then, the web server passes the request to the related filter. Next, the filter may modify the request and perform some login operations.

The complexity of these components makes it very difficult to implement them. Developers have to use C/C ++ to develop these components, but for many people, using C/C ++ for development is simply synonymous with pain.

So what does ASP. NET provide to implement these functions? ASP. NET provides httphandler (HTTP handler) and httpmodule (HTTP module ).

Before learning more about these components, it is valuable to know how HTTP requests are processed through the HTTP module and HTTP processing program.

Create a sample application

I have created the following C # projects to demonstrate different components of the application:

· Newhandler (HTTP handler)

· Webapp (demonstration of HTTP processing programs)

· Securitymodules (HTTP module)

· Webapp2 (demonstrate HTTP module)

Steps for installing these applications:

· Unlock the cause in the attached ZIP file Code .

· Create two virtual directories: webapp and webapp2. Point these two directories to the actual physical directories of the webapp and webapp2 applications.

· Copy the newhandler. dll file in the newhandler project to the bin directory of the webapp.

· Copy the securitymodules. dll file in the securitymodules project to the bin directory of the webapp2 application.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.