3.《简单流程图》


.这个就是处理 【托管程序】的入口方法了
[SecurityPermission(SecurityAction.LinkDemand, Unrestricted=true)]
public int ProcessRequest(IntPtr ecb, int iWRType){
IntPtr zero = IntPtr.Zero;
if ( iWRType == ){zero = ecb;ecb = UnsafeNativeMethods.GetEcb(zero);}
ISAPIWorkerRequest wr = null; //ISAPIWorkerRequest : HttpWorkerRequest
try{
bool useOOP = iWRType == ;
wr = ISAPIWorkerRequest.CreateWorkerRequest(ecb, useOOP);//将 ecb 句柄封装成 HttpWorkerRequest 的 源码在此 !!!
wr.Initialize();
string appPathTranslated = wr.GetAppPathTranslated();
string appDomainAppPathInternal = HttpRuntime.AppDomainAppPathInternal;
if ((appDomainAppPathInternal == null) || StringUtil.EqualsIgnoreCase(appPathTranslated, appDomainAppPathInternal))
{
HttpRuntime.ProcessRequestNoDemand(wr);
return ;
}
object[] args = new object[] { appDomainAppPathInternal, appPathTranslated };
HttpRuntime.ShutdownAppDomain(ApplicationShutdownReason.PhysicalApplicationPathChanged, SR.GetString("Hosting_Phys_Path_Changed", args));
return ;
}catch (Exception exception){
try{ WebBaseEvent.RaiseRuntimeError(exception, this); }catch{}
if ( (wr == null) || !(wr.Ecb == IntPtr.Zero) ){throw;}
if ( zero != IntPtr.Zero ){UnsafeNativeMethods.SetDoneWithSessionCalled(zero);}
if ( exception is ThreadAbortException ){Thread.ResetAbort();}
return ;
}
}
.aspx页面的执行过程,可以在页面加入<%@ Page Language="C#" Trace="true" %> aspx页面执行流程会在浏览器中显示
