ÈçºÎÌá¸ßASP.NETÒ³ÃæÔØÈëËٶȵķ½·¨
1.²ÉÓà HTTP Module ¿ØÖÆÒ³ÃæµÄÉúÃüÖÜÆÚ¡£
2.×Ô¶¨ÒåResponse.FilterµÃµ½Êä³öÁ÷streamÉú³É¶¯Ì¬Ò³ÃæµÄ¾²Ì¬ÄÚÈÝ(´ÅÅÌ»º´æ)¡£
3.Ò³ÃæGZIPѹËõ¡£
4.OutputCache ±à³Ì·½Ê½Êä³öÒ³Ã滺´æ¡£
5.ɾ³ýÒ³Ãæ¿Õ°××Ö·û´®¡££¨ÀàËÆGoogle£©
6.Íêȫɾ³ýViewState¡£
7.ɾ³ý·þÎñÆ÷¿Ø¼þÉú³ÉµÄÀ¬»øNamingContainer¡£
8.ʹÓüƻ®ÈÎÎñ°´Ê±Éú³ÉÒ³Ãæ¡££¨±¾ÎIJ»°üº¬¸Ã×ö·¨µÄʵÏÖ£©
9.JS£¬CSSѹËõ¡¢ºÏ²¢¡¢»º´æ£¬Í¼Æ¬»º´æ¡££¨ÏÞÓÚÎÄÕÂƪ·ù£¬±¾ÎIJ»°üº¬¸Ã×ö·¨µÄʵÏÖ£©
10.»º´æÆÆ»µ¡££¨²»°üº¬µÚ9×ö·¨µÄʵÏÖ£©
Õë¶ÔÉÏÊö×ö·¨£¬ÎÒÃÇÊ×ÏÈÐèÒªÒ»¸ö HTTP Ä£¿é£¬ËüÊÇÕû¸öÒ³ÃæÁ÷³ÌµÄÈë¿ÚºÍºËÐÄ¡£
Ò»¡¢×Ô¶¨ÒåResponse.FilterµÃµ½Êä³öÁ÷streamÉú³É¶¯Ì¬Ò³ÃæµÄ¾²Ì¬ÄÚÈÝ(´ÅÅÌ»º´æ)
ÈçϵĴúÂëÎÒÃÇ¿ÉÒÔ¿´³ö£¬ÎÒÃÇÒÔ request.RawUrl
Ϊ»º´æ»ù´¡£¬ÒòΪËü¿ÉÒÔ°üº¬ÈÎÒâµÄQueryString±äÁ¿£¬È»ºóÎÒÃÇÓÃMD5¼ÓÃÜRawUrl
µÃµ½·þÎñÆ÷±¾µØÎļþÃûµÄ±äÁ¿£¬ÔÙʵÀý»¯Ò»¸öFileInfo²Ù×÷¸ÃÎļþ£¬Èç¹ûÎļþ×îºóÒ»´ÎÉú³Éʱ¼äСÓÚ7Ì죬ÎÒÃǾÍʹÓÃ.Net2.0ÐÂÔöµÄ
TransmitFile·½·¨½«´æ´¢ÎļþµÄ¾²Ì¬ÄÚÈÝ·¢Ë͵½ä¯ÀÀÆ÷¡£Èç¹ûÎļþ²»´æÔÚ£¬ÎÒÃǾͲÙ×÷ response.Filter µÃµ½µÄ Stream
´«µÝ¸ø CommonFilter À࣬²¢ÀûÓÃFileStreamдÈ붯̬ҳÃæµÄÄÚÈݵ½¾²Ì¬ÎļþÖС£
view
source
< id="highlighter_476669_clipboard" title="copy to clipboard"
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="16"
height="16"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
type="application/x-shockwave-flash">
print
?
01
namespace
ASPNET_CL.Code.HttpModules
02
{
03
public
class
CommonModule
: IHttpModule
04
{
05
public
void
Init(HttpApplication
application)
06
{
07
application.BeginRequest +=
Application_BeginRequest;
08
}
09
private
void
Ïà¹ØÎĵµ£º
Asp.netµÄÉí·ÝÑéÖ¤ÓÐÓÐÈýÖÖ£¬·Ö±ðÊÇ"Windows | Forms | Passport"£¬ÆäÖÐÓÖÒÔFormsÑéÖ¤ÓõÄ×î¶à£¬Ò²×îÁé»î¡£
Forms ÑéÖ¤·½Ê½¶Ô»ùÓÚÓû§µÄÑéÖ¤ÊÚȨÌṩÁ˺ܺõÄÖ§³Ö£¬¿ÉÒÔͨ¹ýÒ»¸öµÇ¼ҳÃæÑéÖ¤Óû§µÄÉí·Ý£¬½«´ËÓû§µÄÉí·Ý·¢»Øµ½¿Í»§¶ËµÄCookie£¬Ö®ºó´ËÓû§ÔÙ·ÃÎÊÕâ¸öwebÓ¦ÓþͻáÁ¬Í¬Õâ¸öÉí·ÝCookieÒ»Æð·¢Ë͵½·þÎñ¶Ë¡£·þÎñ¶ËÉ ......
public static void SetEnterControl(System.Web.UI.Control Ctrl)
{
Page mPage = Ctrl.Page;
string mScript;
mScript = @"<script language=""jav ......
ASP.NET 4µÄWeb Formsµ±ÖУ¬×îÁîÈ˼¤É͵ģ¬ÔòĪ¹ýÓÚÊÇURL Routing»úÖƵÄÈ«ÃæÖ§³Ö¡£¹ýÈ¥ÔÚASP.NET 3.5 SP1µ±ÖУ¬Web Forms»ò¶à»òÉپͿªÊ¼Ö§³ÖURL Routing»úÖÆ£¬ËüÈÃÎÒÃÇÔÚÍøÖ·µÄ³ÊÏÖÒÔ¼°Ê¹ÓÃÉϸü¼ÓµÄÓе¯ÐÔ¡£
¹ýÈ¥ÎÒÃÇÔÚASP.NETµ±ÖУ¬Ï°¹ßÓÚµ×ÏÂÕâÑùµÄÍøÖ·³ÊÏÖ·½Ê½£º
http://myWebSite/EditProduct.aspx?Id=1
µ«×î½ü¼¸ÄêR ......
Ò»¡¢»ñÈ¡µ±Ç°ÎļþµÄ·¾¶
1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName
»ñÈ¡Ä£¿éµÄÍêÕû·¾¶£¬°üÀ¨ÎļþÃû¡£
2. System.Environment.CurrentDirectory
»ñÈ¡ºÍÉèÖõ±Ç°Ä¿Â¼(¸Ã½ø³Ì´ÓÖÐÆô¶¯µÄĿ¼)µÄÍêÈ«ÏÞ¶¨Ä¿Â¼¡£ ......
½ñÌìÔÚ×öÒ»¸öÎÞË¢ÐÂÅжϹ«Ë¾Ãû³Æ£¬ÊÇ·ñÖظ´µÄʱºò£¬·¢ÏÖÒ»¸öÎÊÌâ¾ÍÊÇͨ¹ýjavascript´«µ½asp.netÒ³ÃæµÄÖµÊÇÂÒÂë¡£ÒÔǰûÓз¢ÏÖ¡£ÒòΪ ÒÔÇ°×ö²âÊÔʱ£¬¶¼ÊÇÓÃÓ¢ÎÄ×Ö·û½øÐеIJâÊÔ¡£½ñÌìÊäÈ뺺×ֺ󣬷¢ÏÖÓÐÕâÖÖÎÊÌâ¡£¸Ð¾õ¿ÉÄÜÊDZàÂëµÄÎÊÌâ¡£¾ÍÉÏÍø²éÁËһϡ£ÕÒµ½Ò»Ð©·½·¨£¬ÈçÏ£º
1.ÉèÖÃweb.configÎļþ
<system.web>
&l ......