易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net 运行原理

主要类:
  System.Web.HttpRuntime
  System.Web.HttpApplicationFactory
  System.Web.HttpApplication
  System.Web.Compilation.BuildManager
  System.Web.Compilation.ApplicationBuildProvider
  System.Web.Compilation.BuildProvidersCompiler
  System.Web.UI.PageHandlerFactory
请求处理简要流程图:
分析:
当我们通过浏览器向ASP.NET 2.0网站的一个asp.net页面发起请求时,在服务器端首先是IIS收到请求,IIS一看是asp.net页面,心里很开心,因为这个请求不用它处理,交给ASP.NET ISAPI就行了。ASP.NET ISAPI的工作也比较轻松,他的主要任务就是安排aspnet_wp.exe处理请求,并监视aspnet_wp.exe进程的执行情况,如果aspnet_wp.exe进程太累了,不能出色地完成任务,ASP.NET ISAPI就要让他下岗,换一个新的aspnet_wp.exe来处理工作。
 aspnet_wp.exe的主要任务是将请求交给一系列称为的 HTTP 管道的托管对象。如果把ASP.NET ISAPI比做销售经理,那aspnet_wp.exe就是生产经理,而HTTP 管道就是生产的流水线。负责流水线的小组就是HttpRuntime,生产经理aspnet_wp.exe会将订单(HTTP请求)交给HttpRuntime小组的工作人员ProcessRequest(HttpWorkerRequest wr),HttpRuntime根据内部的分工,最终由ProcessRequestInternal(HttpWorkerRequest wr)在流水线上进行生产,所以ProcessRequestInternal(HttpWorkerRequest wr)是我们分析的重点。
首先看一下ProcessRequestInternal(HttpWorkerRequest wr)的代码:
 private void ProcessRequestInternal(HttpWorkerRequest wr)
{
// 初始化HttpContext实例
HttpContext extraData = new HttpContext(wr, false);
wr.SetEndOfSendNotification(this._asyncEndOfSendCallback, extraData);
Interlocked.Increment(ref this._activeRequestCount);
HostingEnvironment.IncrementBusyCount();
// 对第一次请求初始化
try
{
try
{
this.EnsureFirstRequestInit(extraData);
}
catch
{
if (!extraData.Request.IsDebuggingRequest)
{
throw;
}
}
// 初始化HttpWriter实例
extraData.Response.InitResponseWriter();
// 创建HttpApplication实例
IHttpHandler a


相关文档:

ASP.NET页面重定向方法小结

引自: http://renhappy20066.blog.163.com/blog/static/112080786200961172521923/
ASP.NET页面重定向方法小结
asp.net   2009-07-11 07:25   阅读54   评论0  
字号: 大大  中中  小小
页面重定向的使用很多,实现方法也有不同,自己也试过几种,现在总结一下。 ......

asp.net动态生成TreeView

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient; ......

ASP.NET中cookie的几种创建和访问方法

来源:草根站长
Cookie (HttpCookie的实例)提供了一种在 Web 应用程序中存储用户特定信息的方法。例如,当用户访问您的站点时,您可以使用Cookie 存储用户首选项或其他信息。当该用户再次访问您的网站时,应用程序便可以检索以前存储的信息。
ASP.NET中的cookie:创建Cookie方法 (1)
Response.Cookies["userName"].Valu ......

ASP.NET关闭当前窗口同时打开一个新窗口

首先,在pageload里写入以下代码:Response.Write("<script>window.opener=null;window.close();</script>");
其次,在head里写下如下JS代码: <script language="JavaScript">
<!--
function openwin() { window.open ("Default.aspx", "newwindow", "height=600, width=600, toolbar=no, menubar=n ......

ASP.NET拆分单元格方法

 protected void Unite(GridView gv)
    {
        int i;
        string LastType1;
        int LastCell;
        if (gv.Rows.Count > ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号