{"id":378,"date":"2010-10-01T02:15:10","date_gmt":"2010-10-01T02:15:10","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=378"},"modified":"2010-10-01T02:15:10","modified_gmt":"2010-10-01T02:15:10","slug":"aspx%e6%89%a7%e8%a1%8c%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2010\/10\/01\/aspx%e6%89%a7%e8%a1%8c%e6%b5%81%e7%a8%8b\/","title":{"rendered":"ASPX\u6267\u884c\u6d41\u7a0b"},"content":{"rendered":"<p>\u6bcf\u4e00\u4e2a<a href=\"http:\/\/asp.net\/\">ASP.NET<\/a>\u7a0b\u5e8f\u6267\u884c\u65f6\u90fd\u4f1a\u5bf9\u5f53\u524dURL\u7684\u8bf7\u6c42\u8fdb\u884c\u89e3\u6790\uff0c\u672c\u6587\u5c06\u5206\u6790<a href=\"http:\/\/asp.net\/\">ASP.NET<\/a>\u9875\u9762\u8bf7\u6c42\u7684\u539f\u7406\u3002\u5f53\u6211\u4eec\u5728\u6d4f\u89c8\u5668\u4e0a\u8f93\u5165\u4e00\u4e2aURL\u65f6\uff0c \u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p>\u9996\u5148\u88abWWW\u670d\u52a1\u5668\u622a\u83b7\uff08inetinfo.exe\u8fdb\u7a0b\uff09\uff0c \u8be5\u8fdb\u7a0b\u9996\u5148\u5224\u65ad\u9875\u9762\u540e\u7f00\uff0c \u7136\u540e\u6839\u636eIIS\u4e2d\u914d\u7f6e\u51b3\u5b9a\u8c03\u7528\u5177\u4f53\u7684\u6269\u5c55\u7a0b\u5e8f\u3002<\/p>\n<p>\u5982aspx\u5c31\u4f1a\u8c03\u7528aspnet_isapi.dll, \u7136\u540e\u7531aspnet_isapi.dll\u53d1\u9001\u7ed9w3wp.exe\uff08iis \u5de5\u4f5c\u8005\u8fdb\u7a0b\uff0cIIS6.0\u4e2d\u53eb\u505a w3wq.exe\uff0cIIS5.0\u4e2d\u53eb\u505a aspnet_wp.exe).<\/p>\n<p>\u63a5\u4e0b\u6765\u5c31\u662f<a href=\"http:\/\/w3wp.xn--exe-es1h888g.net\/\">w3wp.exe\u8c03\u7528.net<\/a>\u7c7b\u5e93\u8fdb\u884c\u5177\u4f53\u5904\u7406\uff0c\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p>ISAPIRuntime&#8211;&gt;HttpRuntime&#8211;&gt;HttpApplicationFactory&#8211;&gt;HttpApplication&#8211;&gt;HttpModule&#8211;HttpHandlerFactory&#8211;&gt;HttpHandle<\/p>\n<p>1. ISAPIRuntime<\/p>\n<p>\u4e3b\u8981\u4f5c\u7528\u662f\u8c03\u7528\u4e00\u4e9b\u975e\u6258\u7ba1\u4ee3\u7801\u751f\u6210HttpWorkerRequest\u5bf9\u8c61\uff0cHttpWorkerRequest\u5bf9\u8c61\u5305\u542b\u5f53\u524d\u8bf7\u6c42\u7684\u6240\u6709\u4fe1\u606f\uff0c\u7136\u540e\u4f20\u9012\u7ed9HttpRuntime\uff0c\u8fd9\u91cc\u751f\u6210\u7684HttpWorkerRequest\u5bf9\u8c61\u53ef\u4ee5\u76f4\u63a5\u5728\u6211\u4eec\u7684\u9875\u9762\u4e2d\u8c03\u7528\u7684\uff0c\u901a\u8fc7\u5b83\u53d6\u5f97\u539f\u59cb\u7684\u8bf7\u6c42\u4fe1\u606f\uff1a<\/p>\n<p>2. HttpRuntime<br \/>\na. \u6839\u636eHttpWorkerRequest\u5bf9\u8c61\u751f\u6210HttpContext\uff0cHttpContext\u5305\u542brequest\u3001response\u7b49\u5c5e\u6027\uff1b<br \/>\nb. \u8c03\u7528HttpApplicationFactory\u6765\u751f\u6210IHttpHandler(\u8fd9\u91cc\u751f\u6210\u7684\u662f\u4e00\u4e2a\u9ed8\u8ba4\u7684HttpApplication\u5bf9\u8c61\uff0cHttpApplication\u4e5f\u662fIHttpHandler\u63a5\u53e3\u7684\u4e00\u4e2a\u5b9e\u73b0)<br \/>\nc. \u8c03\u7528HttpApplication\u5bf9\u8c61\u6267\u884c\u8bf7\u6c42<\/p>\n<p>3. HttpApplicationFactory.<\/p>\n<p>\u4e3b\u8981\u662f\u751f\u6210\u4e00\u4e2aHttpApplication\u5bf9\u8c61\uff1a<\/p>\n<p>\u9996\u5148\u4f1a\u67e5\u770b\u662f\u5426\u5b58\u5728global.asax\u6587\u4ef6\uff0c\u5982\u679c\u6709\u7684\u8bdd\u5c31\u7528\u5b83\u6765\u751f\u6210HttpApplication\u5bf9\u8c61\uff0c\u4ece\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u770b\u5230<a href=\"http:\/\/global.xn--asaxasp-hg5kj29afyhgw6bxwb369g.net\/\">global.asax\u7684\u6587\u4ef6\u540d\u662f\u5728asp.net<\/a>\u7684\u6846\u67b6\u4e2d\u5199\u6b7b\u7684\uff0c\u4e0d\u80fd\u4fee\u6539\u7684\u3002\u5982\u679c\u8fd9\u4e2a\u6587\u4ef6\u4e0d\u5b58\u5728\u5c31\u4f7f\u7528\u9ed8\u8ba4\u7684\u5bf9\u8c61\u3002<\/p>\n<p>4. HttpApplication<\/p>\n<p>\u8fd9\u4e2a\u662f\u6bd4\u8f83\u590d\u6742\u4e5f\u6bd4\u8f83\u91cd\u8981\u7684\u4e00\u4e2a\u5bf9\u8c61, \u9996\u5148\u662f\u6267\u884c\u521d\u59cb\u5316\u64cd\u4f5c\uff0c\u6bd4\u8f83\u91cd\u8981\u7684\u4e00\u6b65\u5c31\u662f\u8fdb\u884cHttpModule\u7684\u521d\u59cb\u5316\uff1a<\/p>\n<p>HttpApplication\u4ee3\u8868\u7740\u7a0b\u5e8f\u5458\u521b\u5efa\u7684Web\u5e94\u7528\u7a0b\u5e8f\u3002HttpApplication\u521b\u5efa\u9488\u5bf9\u6b64Http\u8bf7\u6c42\u7684 HttpContext\u5bf9\u8c61\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u5305\u542b\u4e86\u5173\u4e8e\u6b64\u8bf7\u6c42\u7684\u8bf8\u591a\u5176\u4ed6\u5bf9\u8c61\uff0c\u4e3b\u8981\u662fHttpRequest\u3001HttpResponse\u3001 HttpSessionState\u7b49\u3002\u8fd9\u4e9b\u5bf9\u8c61\u5728\u7a0b\u5e8f\u4e2d\u53ef\u4ee5\u901a\u8fc7Page\u7c7b\u6216\u8005Context\u7c7b\u8fdb\u884c\u8bbf\u95ee\u3002<\/p>\n<p>\u5b83\u4f1a\u8bfb\u53d6web.config\u4e2d\u6240\u6709HttpModule\u7684\u914d\u7f6e<\/p>\n<p>5. HttpModule<\/p>\n<p>6. HttpHandlerFactory<\/p>\n<p>7. HttpHandler<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6bcf\u4e00\u4e2aASP.NET\u7a0b\u5e8f\u6267\u884c\u65f6\u90fd\u4f1a\u5bf9\u5f53\u524dURL\u7684\u8bf7\u6c42\u8fdb\u884c\u89e3\u6790\uff0c\u672c\u6587\u5c06\u5206\u6790ASP.NET\u9875\u9762\u8bf7\u6c42\u7684\u539f\u7406\u3002\u5f53\u6211\u4eec\u5728 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-aspdotnet"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}