Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Asp.net ÓÃurlÖØд(URLReWriter)ʵÏÖÈÎÒâ¶þ¼¶ÓòÃû

À´ÕÒÕâƪÎÄÕµÄ,Ó¦¸Ã¶¼ÖªµÀʲô½Ð¶þ¼¶ÓòÃû°É,·Ï»°¾Í²»ËµÁË.µ«ÊÇÌÖÂÛÇ°,ÏÈÒªÃ÷°×Ò»¸ö˼ÏëÎÊÌâ.
ºÜ¶àÅóÓÑÒ»Ö±¿¼ÂDz»Çå(ÎÒÇ°¼¸ÌìÒ²Ò»Ö±¸ã²»Ã÷°×)µÄÎÊÌâÊÇ,ÎÒ¼üÈëÒ»¸öµØÖ·ºó,ÔõôÕâ¸öurl¾Í±»ÖØдÁË?
µÚÒ»²½:ÔÚä¯ÀÀÆ÷¼üÈëÁËÒ»¸öµØÖ·,±ÈÈçhttp://love.kerry.com,µã»Ø³µºó,¶¼·¢ÉúÁËʲô?
ΪÁË°ÑÎÊÌâ¼òµ¥»¯,ÎÒÀ´ÕâÑù½âÊÍ:
µÚ¶þ²½:Ê×ÏÈ,¼üÈëµÄµØÖ·±»½âÎö,×îÖÕÀ´µ½ÁËһ̨web·þÎñÆ÷.½»¸øIIS´¦Àí.ÔÚ.netµÄÊÀ½çÖÐ,IIS»á°ÑÕâÑùµÄÇëÇóÔÙ½»¸øÒ»¸öweb´¦ÀíÆ÷ ´¦Àí,×îºó,¸Ã web´¦ÀíÆ÷ °Ñ´¦ÀíµÄ½á¹û·µ»Ø¸øä¯ÀÀÆ÷,ÏÔʾ¸øÓû§¿´.
Çë²»ÓúöÂÔÕâÑùÒ»¸öÎÊÌâ,µÚ¶þ²½µÄËùÓÐÊÂÇ鶼ÊÇÔÚ·þÎñÆ÷¶Ë×öµÄ.ÔÚÕâЩÊÂÇé½øÐеÄʱºò,Óû§¶ËµÄä¯ÀÀÆ÷ÉÏÃæµÄµØÖ·²»»á¸Ä±ä.¼´Ê¹×îºó web´¦ÀíÆ÷ °Ñ´¦Àí½á¹û·µ»ØÀ´µÄʱºò,ÉÏÃæµÄµØÖ·Ò²²»»á¸Ä±ä.
Ò»¿ªÊ¼¼üÈëµÄurl,Ö»ÊÇÆðÒ»¸öÇÃÃŵÄ×÷ÓÃ,ÃÅÇÃÍêÁË,×÷ÓþÍËã½áÊøÁË,Ö»ÓÐÄãµÄÑÛ¾¦¿ÉÒÔ¿´µ½ÄǸöµØÖ·,ä¯ÀÀÆ÷,·þÎñÆ÷µÈ¶¼²»ÖªµÀÕâ¸öµØÖ·.
È»ºóÒªÃ÷°×µÄÎÊÌâÊÇ,ËùνurlÖØд,Ò²Ö»ÊÇweb¿ª·¢ÈËÔ±ÖªµÀµÄÄÚÄ»Çé¿ö,Óû§¸ù±¾²»ÖªµÀ·¢ÉúÁËʲô,ËûÈÏΪ×Ô¼º¼üÈëµÄµØÖ·¾ÍÊÇÓ¦¸Ã³öÀ´ÆÁÄ»ÉÏÏÔʾµÄ½á¹û.Ò²¾ÍÊÇ˵,ÎÒÃÇÔÚÄ»ºó¿ØÖÆÒªÏÔʾµÄÄÚÈÝ.
½ÓÏÂÀ´Òª¿¼ÂǵÄÊÇ,ÔõôÑù¿ØÖÆÏÔʾµÄÄÚÈÝ?
´ÓÉÏÃæ˵µÄ¹ý³Ì,ºÜÃ÷ÏÔÒªÔÚ web´¦ÀíÆ÷ µÄ¹¤×÷ÕâÒ»²½¶¯ÊÖ½Å.
Ò»¸ö×î¼òµ¥µÄ¿¼ÂÇÊÇ,Óû§ÇÃÈëÁËÒ»¸ö¼òµ¥µÄ²»´øÈκβÎÊýµØÖ·, http://love.kerry.comÈ»ºóÎÒÃÇ°ÑÕâ¸öµØÖ·¸Ä³ÉÒ»¸ö·ûºÏ³ÌÐòÐèÒªµÄ´ø²ÎÊýµÄµØÖ·, http://kerry.com?lover=notus,×îºó´¦ÀíÖ®.
ËùνµÄurlÖØд,¾ÍÊÇÔÚÕâÒ»²½.
ÓÃ.netµÄÊõÓïÀ´Ëµ,ÎÒÃÇÐèÒª¸øÓ¦ÓóÌÐò×¢²áÒ»¸öhttpmodule,ÓÃÀ´´¦ÀíÌض¨µÄurl
×¢²áhttpmodule,ÔÚweb.config,
´¦Àíurl,ÔÚÎÒÃÇÌṩµÄhttpmodule³ÌÐòÖÐ
´óÌåÏ൱ÓÚÕâÑùµÄÒ»¶Î³ÌÐò
//ÓÃÎÒÃǵÄhttpmodule³ÌÐò½Ø»ñԭʼurl
String OriginalUrl=” http://love.kerry.com”;
//´¦Àíԭʼurl,µÃµ½×îºóÐèÒªµÄurl,ֵΪhttp://kerry.com?lover=notus
String FinalUrl=Rewrite(OriginalUrl);
// contextÖØн«urlÔÚÄÚ²¿·¢Ë͸øIIS´¦Àí
context.RewritePath(FinalUrl);
½ÓÏÂÀ´,ÎÒÃÇÀ´ÊµÏÖurlÖØд.
µÚÒ»²½:È·¶¨Òª¶ÔÄÄЩurlÖ´ÐÐÖØд,¼´Öƶ¨ÖØд¹æÔò
µÚ¶þ²½:±àдhttpmodule´¦Àí³ÌÐò
µÚÈý²½:½«±àдµÄhttpmoduleÕûºÏÈëweb³ÌÐò,¿ªÊ¼¹¤×÷.
ÉÏÃæ¾ÍÊÇurlÖØдµÄ»ù±¾ÖªÊ¶,¶øÓÃurlÖØдʵÏÖ¶þ¼¶ÓòÃû,¹ý³ÌÒ»Ñù.ÒòΪÎÞÂÛÊǶþ¼¶ÓòÃû»¹ÊÇÈý¼¶ÓòÃû,¶¼ÊÇÒ»¸öurlµØÖ·.Ö»ÒªÎÒÃǽػñÕâ¸öurlµØÖ·,¾Í¿ÉÒÔÔÚ´¦ÀíµÄʱºò¶¯ÊÖ½Å.


Ïà¹ØÎĵµ£º

ÅäÖÃASP.netÔËÐÐÈÕÖ¾

ÎÒÖ÷ÒªÓÃÀ´¸ú×Ùºǫ́µÄһЩÇé¿ö£¬ÎÒÓõÄÊÇÒ»¸öµÚÈý·½²å¼þ£¬ºÜºÃÓõÄ
log4net
¾ßÌåʹÓÃÈçÏ£º
Web.configÅäÖãº
<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<log4net>
 &nbs ......

ASP.Net Ò³Ã滺´æƬ¶ÎʹÓü¼ÇÉ

Ò³Ã滺´æʹÓÃOutputCacheÖ¸Áî¡£ÆäÖÐDurationºÍVaryByParamÌØÐÔÊDZØÐëµÄ¡£ Location¿ØÖÆÒ³Ã滺´æµÄλÖÃLocationº¬ÒåAnyĬÈÏÖµ¡£Òâζ×ÅÒ³ÃæµÄÊä³ö¿ÉÒÔ»º´æÔÚ¿Í»§¶Ëä¯ÀÀÆ÷£¬»º´æÔÚÈκÎ"ÏÂÓÎ"µÄ¿Í»§¶Ë£¨Èç´úÀí·þÎñÆ÷£©£¬»ò»º´æÔÚWeb·þÎñÆ÷±¾ÉíClientÖ¸Ã÷Êä³ö»º´æÖ»ÄÜ´æ´¢ÔÚ·¢³öÇëÇóµÄ¿Í»§¶Ë£¨¼´ä¯ÀÀÆ÷£©µÄ±¾µØ»º´æÖÐDownstreamÖ ......

asp.netµÄ³£ÓôúÂë

 
0.ÓÃsessionÅжÏÊÇ·ñµÇ½
if(Session["login"] == null)
   {
    Response.Redirect("error.aspx");
   }
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</s ......

·¢²¼ASP.NETÓ¦ÓÃ

1¡¢°²×°IIS£»
2¡¢°²×°.NET Framework 3.5£»
3¡¢ÔËÐÐC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i£»
4¡¢Ð½¨ÐéÄâĿ¼(ÍøÕ¾)µØÖ·¶ÔÓ¦Îļþ¼Ð(¸ÃÎļþ¼Ð°üº¬£º.master .aspx css js imge binµÈµÈ)£»
5¡¢ÅäÖÃÐéÄâĿ¼(ÍøÕ¾)ÊôÐÔASP.NET£¬°æ±¾Îªv2.0.50727,Îĵµ£ºÄ¬ÈÏÎĵµÎªDefault.aspx£»
6¡¢ÉèÖÃÐé ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ