IHttpHandler 接口

定义

定义 ASP.NET 为使用自定义 HTTP 处理程序同步处理 HTTP Web 请求而实现的协定。Defines the contract that ASP.NET implements to synchronously process HTTP Web requests using custom HTTP handlers.

public interface class IHttpHandler
public interface IHttpHandler
type IHttpHandler = interface
Public Interface IHttpHandler
派生

注解

你可以编写自定义 HTTP 处理程序来处理任何符合公共语言规范 (CLS) 的语言的特定、预定义类型的 HTTP 请求。You can write custom HTTP handlers to process specific, predefined types of HTTP requests in any Common Language Specification (CLS) compliant language. HttpHandler类中定义的可执行代码 (而不是传统的 ASP 或 ASP.NET 网页) 对这些特定请求做出响应。Executable code defined in the HttpHandler classes, rather than conventional ASP or ASP.NET Web pages, responds to these specific requests. HTTP 处理程序为您提供了一种与 IIS Web 服务器的低级请求和响应服务交互的方法, 并提供了与 ISAPI 扩展相同的功能, 但具有更简单的编程模型。HTTP handlers give you a means of interacting with the low-level request and response services of the IIS Web server and provide functionality much like ISAPI extensions but with a simpler programming model.

如果处理程序将访问会话状态值, 则它必须实现IRequiresSessionState接口 (不带方法的标记接口)。If your handler will access session state values, it must implement the IRequiresSessionState interface (a marker interface with no methods).

属性

IsReusable

获取一个值,该值指示其他请求是否可以使用 IHttpHandler 实例。Gets a value indicating whether another request can use the IHttpHandler instance.

方法

ProcessRequest(HttpContext)

通过实现 IHttpHandler 接口的自定义 HttpHandler 启用 HTTP Web 请求的处理。Enables processing of HTTP Web requests by a custom HttpHandler that implements the IHttpHandler interface.

适用于