IIS6服务器的请求流程(图文&源码)

2018-06-22 07:54:50来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

1.IIS 7开发与管理完全参考手册  http://book.51cto.com/art/200908/146040.htm

2.Web服务IIS 6   https://technet.microsoft.com/zh-cn/library/2005.05.servingtheweb(en-us).aspx

3.简单流程图

 

 

 

 

 

 4.这个就是处理 【托管程序】的入口方法了  

 1 [SecurityPermission(SecurityAction.LinkDemand, Unrestricted=true)]
 2 public int ProcessRequest(IntPtr ecb, int iWRType){
 3     IntPtr zero = IntPtr.Zero;
 4     if ( iWRType == 2 ){zero = ecb;ecb = UnsafeNativeMethods.GetEcb(zero);}
 5     ISAPIWorkerRequest wr = null; //ISAPIWorkerRequest : HttpWorkerRequest
 6     try{
 7         bool useOOP = iWRType == 1;
 8         wr = ISAPIWorkerRequest.CreateWorkerRequest(ecb, useOOP);//将 ecb 句柄封装成 HttpWorkerRequest 的 源码在此 !!!
 9         wr.Initialize();
10         string appPathTranslated = wr.GetAppPathTranslated();
11         string appDomainAppPathInternal = HttpRuntime.AppDomainAppPathInternal;
12 
13         if ((appDomainAppPathInternal == null) || StringUtil.EqualsIgnoreCase(appPathTranslated, appDomainAppPathInternal))
14         {
15             HttpRuntime.ProcessRequestNoDemand(wr);
16             return 0;
17         }
18 
19         object[] args = new object[] { appDomainAppPathInternal, appPathTranslated };
20         HttpRuntime.ShutdownAppDomain(ApplicationShutdownReason.PhysicalApplicationPathChanged, SR.GetString("Hosting_Phys_Path_Changed", args));
21         return 1;
22     }catch (Exception exception){
23         try{ WebBaseEvent.RaiseRuntimeError(exception, this); }catch{}
24         if ( (wr == null) || !(wr.Ecb == IntPtr.Zero) ){throw;}
25         if ( zero != IntPtr.Zero ){UnsafeNativeMethods.SetDoneWithSessionCalled(zero);}
26         if ( exception is ThreadAbortException ){Thread.ResetAbort();}
27         return 0;
28     }
29 }

5.aspx页面的执行过程,可以在页面加入<%@ Page Language="C#"  Trace="true" %> aspx页面执行流程会在浏览器中显示

 

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:在已有的数据库中修改数据类型步骤

下一篇:获取WebService的请求信息