asp.netʵÏÖURLÖØд
ÒÔ.aspx\.asp\.php½áβµÄҳα¾²Ì¬ÎªÒÔ.htm»òÕß.html½áβµÄÒ³ÓÐʲô¿´·¨,ÐÔÄÜ»áµÃµ½Ìá¸ßÂð,ÓÐʲôºÃ´¦?
ÄÇô»òÕßÖ±½ÓÉú³É¾²Ì¬Ò³ÃæÓÖÓÐʲôºÃ´¦,ÊÇ·ñÍƼöÔÚÒ»¸öÍøÕ¾´óÁ¿Ê¹ÓÃÄØ?
¶ÔÓÚÌÚѶÄÇÑùµÄ´óµÄÃÅ»§ÍøÕ¾ËûÃǵÄÐÂÎÅÒ³ÊÇÉú³ÉµÄ¾²Ì¬Ò³ÄØ»òÕßÊÇαװµÄ?
×î¼Ñ´ð°¸£º
ÔËÐÐPHP,ASP.NET,JSP,ColdFusionµÄÍøÒ³·þÎñÆ÷£¨ÈçIIS£¬Apache£©£¬´ó¶à¿ÉÒÔÓÃURL RewritingÀ´ÊµÏÖÒþ²Ø»ò¸Ä±äÍØÕ¹Ãû¡£´óÍøÕ¾£¬ÏóÌÚѶ£¬°Ù¶È£¨ÓÃPHP£©£¬¶¼ÔÚÓÃURL RewritingµÄ·½·¨À´°ÑÍØÕ¹ÃûÒþ²Ø»ò¸Ä±ä¡£ºÃ´¦Óм¸µã£º
1. ËÑË÷ÒýÇæ±È½Ïϲ»¶.html,.htmµÄ£¨Óë.jsp,.php,.aspx,.cffÏà±È£©£¬ÒòΪ.html, .htmÊǾ²Ì¬µÄ£¬¸üÈÝÒ×ÈÃÒýÇæÁ˽âÄãÍøÒ³µÄÄÚÈÝ¡£¶ø¶¯Ì¬ÍøÒ³µÄÄÚÈÝÊǸù¾ÝÓû§£¬À´Êä³ö²»Í¬µÄÄÚÈÝ£¬²»ÈÝÒ×ÈÃÒýÇæÎüÊÕ¾ßÌåHTMLÄÚÈÝ¡£
2. Èç¹û²»ÓÃURL Rewriting½«ÍØÕ¹ÃûÒþ²Ø»ò¸Ä³É.html£¬ÄÇô¼ÙÈçÕâ¸öÍøÕ¾Òª»»¸ö¼¼Êõ»ò°Ñ¶¯Ì¬Ò³Ãæ»»³É¾²Ì¬£¬ÔòÐèҪѰÕÒËùÓк¬ÓÐÍØÕ¹ÃûµÄÁ¬½Ó£¬°ÑÁ¬½ÓËùº¬URL½øÐÐÍØÕ¹ÃûÐ޸ģ¨Èç´ÓJSP»»µ½PHP¼¼Êõ£¬ÔòҪѰÕÒËùÓк¬ÓÐ.jspµÄÒ³Ã棬²¢°ÑËùÓк¬.jspµÄURL¸Ä³É.php£¬·Ñʱ·ÑÁ¦£©¡£URL RewritingÕýºÃ±ÜÃâÁËÕâµã£¬ÒòΪºÃµÄURLÊÇÄÜ×öµ½“²»±äÓ¦Íê±ä”µÄ¡£
3. ·ÀֹijЩºÚ¿Í¶ñÒâ¹¥»÷¡£ÓÐЩ´óÍøÕ¾²ÉÓò»Í¬µÄ¼¼Êõ¿ª·¢²»Í¬¹¦ÄܵÄÒ³Ãæ¡£¶ø°ÑÍØÕ¹Ãû¸Äµô£¬ÈúڿÍÎÞ·¨È·ÈÏ´ËÒ³ÃæÓõļ¼ÊõÊÇʲô£¬´Ó¶ø¾ÍÎÞ´ÓÏÂÊÖ¡£
4. ·½±ã·ÃÎÊÕßʹÓ᣷ÃÎÊÕß²»ÊdzÌÐòÔ±£¬ËûÃDz»Ã÷°×ʲôÊÇ.jsp,.php.aspx£¬ËûÃÇÖ»ÖªµÀURL¡£ËùÒÔͳһ°ÑÍØÕ¹ÃûÄõô£¬»òÕßͬÒâ°ÑÍØÕ¹Ãû»»Îªhtml,htm£¬ÓÐÀûÓÚÓû§µÄʹÓá£Óû§¿ÉÒÔÖªµÀÏÖÔÚÔÚÄãÍøÕ¾µÄλÖã¬ÈçºÎͨ¹ýÊäÈëURLµ½Ä³Ò»Ò³Ãæ¡£
ʵÀý£º
Intelligencia.UrlRewriter.dll aspxÖØдΪhtmlʵÀý
1¡¢http://urlrewriter.net/ ÏÂÔؽâѹËõºó°ÑIntelligencia.UrlRewriter.dll ÎļþÌí¼ÓÒýÓõ½web¹¤³ÌÀï¡£
2.web.configÅäÖãº
<configSections>
<!--UrlRewriter-->
<section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
</configSections>
<system.web>
<!--UrlRewriter-->
<httpModules>
<add type="Intelligencia.UrlRewriter.RewriterHttpModule,I
Ïà¹ØÎĵµ£º
н¨Ò»¸öרÃÅÓÃÀ´´´½¨ÑéÖ¤ÂëͼƬµÄÒ³ÃæValidateCode.aspx
ËüµÄºǫ́csÎļþ´úÂëÈçÏ£º
PageLoad
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
private void Page_Load(object sender, System.EventArgs e)
{
string checkCode = CreateRandomCode(4);
Session["CheckCode"] = checkCode;
CreateImage(checkCode);
}
ÆäÖÐCreateRand ......
Õª Òª
¶«·çÆû³µ´«¶¯ÖáÓÐÏÞ¹«Ë¾¶ÔÍâÍøÕ¾ÊǵäÐ͵ÄÔÚÏßÐû´«Æ½Ì¨, Æ俪·¢»ùÓÚB/SģʽµÄÔÚÏßÐû´«µÄʵÏÖ£¬²ÉÓõÄÊÇASP.NET +sql 2000ģʽ£¬ÊÇÁè¼ÜÓÚ»¥ÁªÍøϵͳÉϵÄÒ»¸öÐû´«Æ½Ì¨£¬ÊǵØÃæÐû´«ÏµÍ³µÄÒ»ÖÖÑÓÉìºÍ»¥²¹¡£µ±ÏÂÔÚÖйú£¬²»Í¬³ÌÐòʵÏÖÔÚÏßÐû´«µÄ³§ÉÌÔ¼Õ¼£·£¸%×óÓÒ£¬Ê£ÏµÄÄÇ£²£²£¥×óÓҵij§ÉÌ£¬¶¼ÔÚŬÁ¦´´Ôì×Å×ö ......
Abs(number) È¡µÃÊýÖµµÄ¾ø¶ÔÖµ¡£
Asc(String) È¡µÃ×Ö·û´®±í´ïʽµÄµÚÒ»¸ö×Ö·ûASCII Âë¡£
Atn(number) È¡µÃÒ»¸ö½Ç¶ÈµÄ·´ÕýÇÐÖµ¡£
CallByName (object, procname, usecalltype,[args()]) Ö´ÐÐÒ»¸ö¶ÔÏóµÄ·½·¨¡¢É趨»ò´«»Ø¶ÔÏóµÄÊôÐÔ¡£
CBool(expression) ת»»±í´ïʽΪBoolean ÐÍ̬¡£
CByte(expression) ת»»±í´ïʽΠ......
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£1. ʹÓÃQueryString±äÁ¿¡£2. ʹÓÃApplication ¶ÔÏó±äÁ¿¡£4. ʹÓÃCookie¶ÔÏó±äÁ¿¡£Õâ¸ö²Å¿ÉÒÔ˵ÊÇÃæÏó¶ÔÏ󿪷¢ËùʹÓõķ½·¨£¬ÆäʹÓÃServer.Transfer·½·¨°ÑÁ÷³Ì´Óµ±Ç°Ò³ÃæÒýµ¼¡£
¡¡¡¡1. ʹÓÃQueryString±äÁ¿
¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ ......
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["login"] != null)
&nb ......