Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 处理程序方法调用_C#_Ihttphandler - Fatal编程技术网

C# 处理程序方法调用

C# 处理程序方法调用,c#,ihttphandler,C#,Ihttphandler,我正在创建一个处理图像的处理程序。当我试图请求urlhttp://localhost/ProcessImage.ashx默认情况下会调用ProcessRequest。这不是构造函数。但是默认情况下它是如何被调用的呢 public class ProcessImage : IHttpHandler { public void ProcessRequest(HttpContext context) { } } 你可以看看这个。对于处理程序(IHttpHandler),只要

我正在创建一个处理图像的处理程序。当我试图请求url
http://localhost/ProcessImage.ashx
默认情况下会调用
ProcessRequest
。这不是
构造函数
。但是默认情况下它是如何被调用的呢

public class ProcessImage : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
    }
}

你可以看看这个。对于处理程序(IHttpHandler),只要您访问/请求处理程序,就会调用ProcessRequest方法的实现。

当请求HTTP处理程序时,ASP.NET会在相应的处理程序上调用ProcessRequest方法。处理程序的ProcessRequest方法创建一个响应,并将其发送回请求浏览器。与任何页面请求一样,响应将通过订阅处理程序运行后发生的事件的任何HTTP模块。参考:@DotNetMirror,你好,你能把这个作为回答吗?