zoukankan      html  css  js  c++  java
  • IIS6服务器的请求流程(图文&源码)

    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页面执行流程会在浏览器中显示

  • 相关阅读:
    react生命周期-渲染阶段
    react声明周期详解
    react子传父
    react 爷爷组件件传递给孙子组件
    react验证参数格式类型
    原生input上传视拼,参数形式 file: (binary)形式的
    L2-4 彩虹瓶 (25分)
    L2-3 深入虎穴 (25分)
    L2-1 链表去重 (25分)
    L1-1 帅到没朋友 (20分)
  • 原文地址:https://www.cnblogs.com/techliang666/p/8004174.html
Copyright © 2011-2022 走看看