因此,我已经使用托管代码创建了IIS(8)模块。模块完成工作后,我想从代码中响应客户端,或者我想让IIS继续执行其工作。
public class MyModule : IHttpModule
{
public void Init(HttpApplication app) {
app.BeginRequest += new EventHandler(beginRequest);
}
public void beginRequest(Object o, EventArgs e) {
// Do my thing here...
if( wantToStopIISFromDoingsItsThing() ) {
app.CompleteRequest();
}
else {
// Please IIS, just continue doing your thing...
}
}
}
现在,我该怎么做其他部分?看来,无论我做什么,IIS都不会继续这样做。如果删除模块,IIS将执行各种操作,例如实际返回网站(我无法控制)……有什么办法吗?