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

    转载于:https://www.cnblogs.com/techliang666/p/8004174.html

  • 相关阅读:
    WebAPI中路由参数中包含字符-点“.”
    Web API 授权筛选器
    WebApi
    C#视频拍照、视频录制项目示例
    WPF 获取鼠标屏幕位置、窗口位置、控件位置
    C#中字符串转换为计算公式
    ffmpeg开发文档
    .net core控制台应用程序初识
    网络书籍
    ffmpeg命令参数详解
  • 原文地址:https://www.cnblogs.com/twodog/p/12137998.html
Copyright © 2011-2022 走看看