ASP»ù´¡½Ì³Ì£ºASPÄÚ½¨¶ÔÏóResponse
µÚ1Ò³/¹²1Ò³
ASP»ù´¡½Ì³Ì£ºASPÄÚ½¨¶ÔÏóResponse
ÔÚÉÏһƪÖÐ×÷Õ߸ø´ó¼ÒÏêϸ½éÉÜÁË ASP ÄÚ½¨¶ÔÏóÖ®Ò» Request µÄʹÓ÷½·¨£¬ÏàП÷λͨ¹ýһϵÁеÄʵ¼ùÒѾÄܹ»ÊìÁ·ÕÆÎÕ£¬±¾Æª½«¼ÌÐø¸ø´ó¼Ò½éÉÜ ASP µÄÁíÒ»¸öÄÚ½¨¶ÔÏó Response¡£
×î½ü£¬ÓкܶàÅóÓÑÀ´¡°Ãöù¡±´ßÎÒ¼Ó¿ì ASP ƪһÎĵÄд×÷Ëٶȣ¬²¢¼±ÇеØѯÎÊÄÄÀïÓйØÓÚ ASP µÄ½Ì²Ä¡£ÎÒÉîÉîµØ±»´ó¼ÒµÄѧϰÈÈÇéËù´ò¶¯£¬Òò´Ë¾ö¶¨½«×Ô¼ºÆ½Ê±ËùËѼ¯µÄһЩ ASP ÐÅÏ¢×ÊÁÏÄóöÀ´ºÍ´ó¼Ò¹²Ïí£¬Ò²Ï£ÍûËùÓеÄÅóÓÑÄÜ¿¶¿®µØ½«×Ô¼ºËѼ¯µÄÓÐ¹Ø ASP µÄ×ÊÁϸæËß×÷Õߣ¬Ð»Ð»¡£ÓÉÓÚÄ¿Ç°¹úÄÚÓÐ¹Ø ASP µÄÖÐÎĽ̲ķïë÷ë½Ç£¬¶øרÃÅÕë¶Ô ASP ÍøÕ¾¿ª·¢µÄÖÐÎĽ̲Ä×÷Õ߸üÊÇÎÅËùδÎÅ£¨¿ÉÄÜÊÇ×÷Õ߹ª¹ÑÎÅ£©£¬Ö»ÊÇ×î½üÌý˵³öÁËÒ»±¾Ç廪´óѧ³ö°æÉç³ö°æµÄ¹ØÓÚ MS InterDev µÄɵ¹ÏÊ飬ÆäÖÐÓÐ ASP µÄ½Ìѧ£¬ºÍÒ»±¾ Active Server Page 2.0 µÄÖÐÎÄÊֲᣬÒò´ËÄ¿Ç°×÷Õß»¹ÊÇÖ÷Ҫͨ¹ý¹úÍâÍøÕ¾À´»ñÈ¡ ASP µÄÓйØÐÅÏ¢ºÍ×ÊÁÏ£¬ÕâÒ²ÊÇ×÷Õßд±¾ÎĵÄÒ»¸öÖ÷ÒªÔÒò¡£ÏÂÃ***Ҿͽ« bookmark ÖеÄһЩ½Ï¾µäµÄ ASP Õ¾µãÂÞÁгöÀ´£º
1¡¢http://www.activeserverpage.com/
ÕâÊÇ×÷Õß·ÃÎÊ×îƵ·±µÄ ASP ÍøÕ¾£¬Ò²ÊÇÊÀ½çÉÏ×î´ó×îÈ«µÄ¹ØÓÚ ASP µÄÍøÕ¾Ö®Ò»£¬ËüÀïÃæ²»µ«ÓÐ×îÐ嵀 ASP ÎÄÏ××ÊÁÏ£¬Ãâ·Ñ×é¼þ£¬»¹ÓÐÒ»±¾ÍêÕûµÄ ASP ÈëÃŽ̲ģ¬Ëü¸üÊÇ ASP ÍøÕ¾µÄÖÐÊàÕ¾µã£¬Í¨¹ýËüÄã¿ÉÒÔµ½´ïÎÞÊýµÄ ASP Ïà¹ØÕ¾µã¡£
2¡¢http://www.asphole.com/
Õâ±¾ÊÇÒ»¸öÕë¶Ô ASP ©¶´¶ø½¨Á¢µÄÕ¾µã£¬µ«ÊÇËüÈ´ÎÞÒÉÊÇÒ»¸öÍ걸µÄ ASP ÐÅÏ¢Õ¾µã£¬Ëü·Çµ«ÌṩÁË ASP µÄÎÄÕ£¬¼°×é¼þ»¹ÌṩÏ꾡͸³¹µÄÁª½ÓµØÖ·¡£
3¡¢http://www.15seconds.com/faq ºÍ http://www.15seconds.com/search
ÕâÊÇÒ»¸ö×÷ÕßËù¿´µ½µÄ×î´óµÄÍøÉÏ ASP ½»Á÷Õ¾µã£¬ËüÓµÓÐ ASP ½âÒɵĴ𰸣¬ASP ÓʼþÇåµ¥ÐÅÏ¢£¬ASP ¼¼ÇÉ£¬Äã¿ÉÄÜÐèÒªÐèÒª¼¸¸öÔµÄʱ¼ä²ÅÄܶÁÍêÕâЩÐÅÏ¢¡£¶øÔÚ http://www.15seconds.com/AllComponents.asp Äã¿ÉÒÔ¶Áµ½×îÐ嵀 ActiveX ×é¼þºÍ´óÁ¿Ãâ·Ñ×é¼þµÄÏêϸ½éÉÜ£¬²¢¸½Óзdz£ÊµÓõÄÎĵµÓëÀý×Ó¡£
4¡¢http://www.microsoft.com/workshop/server/asp/aspfeat.asp
´ó¼Ò¶¼ÖªµÀ Active Server Page ÊÇ΢ÈíÌá³öµÄÒ»Ì×»ùÓÚ NT IIS µÄ WEB ·þÎñÆ÷¶Ë»·¾³£¬ÄÇôÕâ¸öÓÉ΢Èí×Ô¼º½¨Á¢µÄ ASP ¼¼Êõ˵Ã÷Õ¾µã£¬´ó¼Òµ±È»ÊDz»¿É²»¿´µÄ¡£
5¡¢http://www.serverobjects.com/
ÔÚÕâÀïÄã¿ÉÒÔ»ñµÃÎÞÊýʵÓÃµÄ ActiveX ×é¼þ , ²¢ÏÂÔØËüÃǵÄÊÔÓð棬ֻ¿ÉϧÆäÖеĴ󲿷ּ«ºÃµÄ×é¼þ¶¼ÊÇÒª Money µÄ¡£
6¡¢http://www.cyscape.com/asp/browscap/
´ó¼Ò»¹¼ÇµÃ×÷ÕßÔÚ ASP2 Ò»ÎÄÖнéÉܵÄÄǸöÓÃÀ´±æ±ð¿Í»§¶Ëä¯ÀÀÆ÷°æ±¾µÄ Browser Capabilitie ×é¼þÂð£¿ÔÚÕâ¸öÕ¾µãÄã¿ÉÒÔ»ñµÃ×îÐ嵀 BROWSCAP.INI Îļþ£¬ËüÓµÓÐÿһ¸ö ASP °²×°Ê±Î¢ÈíûÓÐÌṩµÄä¯ÀÀÆ÷µÄÐÅÏ¢£¬ÕâÑùÄãÔÚ ASP ÖÐÅжϿͻ§ä¯ÀÀÆ÷ÊǾÍÄܹ»ÍòÎÞһʧÁË¡£
7¡¢http://www.microsoft.com/data/ado/
ASP ×îÇ¿´óÇÒ±ã½ÝµÄ¹¦ÄÜĪ¹ýÓÚͬÊý¾Ý¿âµÄÁ¬½Ó£¬Í¨¹ý ASP ÄÚ½¨µÄ ActiveX ×é¼þ£¬ÎÒÃÇ¿ÉÒÔÇá¶øÒ׾ٵĽ« WEB ÓëËùÓÐºÍ ODBC ¼æÈݵÄÊý¾Ý¿âÁ¬½ÓÆðÀ´£¬ÔÚÕâ¸ö΢ÈíµÄÕ¾µãÉÏÄã¿ÉÒÔ»ñÈ¡ºÜ¶àʵÓÃµÄ ADO ×ÊÁÏ¡£
8¡¢http://www.cobb.com/m_sbn4/
Ò»¸ö²»´íµÄ ASP ÂÛ̳£¬Äã¿ÉÒÔÔÚÄÇÀïÌùÄãµÄÎÊÌ⣬¶ÁÈ¡±ðÈ˵ÄÎÊÌâºÍ½â´ð¡£
ÏÂÃ棬ÎÒÃÇ¿ªÊ¼Ñ§Ï° ASP µÄÁíÒ»¸öÄÚ½¨¶ÔÏó Response¡£
Óë Request ÊÇ»ñÈ¡¿Í»§¶Ë HTTP ÐÅÏ¢Ïà·´ ,Response ¶ÔÏóÊÇÓÃÀ´¿ØÖÆ·¢Ë͸øÓû§µÄÐÅÏ¢£¬°üÀ¨Ö±½Ó·¢ËÍÐÅÏ¢¸øä¯ÀÀÆ÷¡¢Öض¨Ïòä¯ÀÀÆ÷µ½ÁíÒ»¸ö URL »òÉèÖà cookie µÄÖµ¡£
Óï·¨
Response.collection|property|method
Ò»¡¢ÊôÐÔ
1¡¢Buffer
Buffer ÊôÐÔָʾÊÇ·ñ»º³åÒ³Êä³ö¡£µ±»º³åÒ³Êä³öʱ£¬Ö»Óе±Ç°Ò³µÄËùÓзþÎñÆ÷½Å±¾´¦ÀíÍê±Ï»òÕßµ÷ÓÃÁË Flush »ò End ·½·¨ºó£¬·þÎñÆ÷²Å½«ÏìÓ¦·¢Ë͸ø¿Í»§¶Ëä¯ÀÀÆ÷£¬·þÎñÆ÷½«Êä³ö·¢Ë͸ø¿Í»§¶Ëä¯ÀÀÆ÷ºó¾Í²»ÄÜÔÙÉèÖà Buffer ÊôÐÔ¡£Òò´ËÓ¦¸ÃÔÚ .asp ÎļþµÄµÚÒ»Ðе÷Óà Response.Buffer¡£
2¡¢Charset
Charset ÊôÐÔ½«×Ö·û¼¯Ãû³Æ¸½¼Óµ½ Response ¶ÔÏóÖÐ content-type ±êÌâµÄºóÃæ¡£¶ÔÓÚ²»°üº¬ Response.Charset ÊôÐ﵀ ASP Ò³£¬content-type ±êÌ⽫Ϊ :content-type:text/html¡£
ÎÒÃÇ¿ÉÒÔÔÚ .asp ÎļþÖÐÖ¸¶¨ content-type ±êÌ⣬Èç :
¡¡¡¡ < % Response.Charset="gb2312") %>
½«²úÉúÒÔϽá¹û :
¡¡¡¡ content-type:text/html; charset=gb2312
×¢Ò⣬ÎÞÂÛ×Ö·û´®±íʾµÄ×Ö·û¼¯ÊÇ·ñÓÐЧ£¬¸Ã¹¦Äܶ¼»á½«Æä²åÈë content-type ±êÌâÖС£ÇÒÈç¹ûij¸öÒ³°üº¬¶à¸öº¬ÓÐ Response.Charset µÄ±ê¼Ç£¬Ôòÿ¸ö Response.Charset ¶¼½«Ìæ´úÇ°Ò»¸ö CharsetName¡£ÕâÑù£¬×Ö·û¼¯½«±»ÉèÖÃΪ¸ÃÒ³ÖÐ Response.Charset µÄ×îºóÒ»¸öʵÀýËùÖ¸¶¨Öµ¡£
3¡¢ContentType
ContentType ÊôÐÔÖ¸¶¨·þÎñÆ÷ÏìÓ¦µÄ HTTP ÄÚÈÝÀàÐÍ¡£Èç¹ûδָ¶¨ ContentType£¬Ä¬ÈÏΪ text/HTML¡£
4¡¢Expires
Expires ÊôÐÔÖ¸¶¨ÁËÔÚä¯ÀÀÆ÷ÉÏ»º³å´æ´¢µÄÒ³¾à¹ýÆÚ»¹ÓжàÉÙʱ¼ä¡£Èç¹ûÓû§ÔÚij¸öÒ³¹ýÆÚ֮ǰÓֻص½´ËÒ³£¬¾Í»áÏÔʾ»º³åÇøÖеÄÒ³Ãæ¡£Èç¹ûÉèÖà response.expires=0£¬Ôò¿Éʹ»º´æµÄÒ³ÃæÁ¢¼´¹ýÆÚ¡£ÕâÊÇÒ»¸ö½ÏʵÓõÄÊôÐÔ£¬µ±¿Í»§Í¨¹ý ASP µÄµÇ½ҳÃæ½øÈë WEB Õ¾µãºó£¬Ó¦¸ÃÀûÓøÃÊôÐÔʹµÇ½ҳÃæÁ¢¼´¹ýÆÚ£¬ÒÔÈ·±£°²È«¡£
5¡¢ExpiresAbsolute
Óë Expires ÊôÐÔ²»Í¬ ExpiresAbsolute ÊôÐÔÖ¸¶¨»º´æÓÚä¯ÀÀÆ÷ÖеÄÒ³ÃæµÄÈ·Çе½ÆÚÈÕÆÚºÍʱ¼ä¡£ÔÚδµ½ÆÚ֮ǰ£¬ÈôÓû§·µ»Øµ½¸ÃÒ³£¬¸Ã»º´æÖеÄÒ³Ãæ¾ÍÏÔʾ¡£Èç¹ûδָ¶¨Ê±¼ä£¬¸ÃÖ÷Ò³ÔÚµ±ÌìÎçÒ¹µ½ÆÚ¡£Èç¹ûδָ¶¨ÈÕÆÚ£¬Ôò¸ÃÖ÷Ò³Ôڽű¾ÔËÐе±ÌìµÄÖ¸¶¨Ê±¼äµ½ÆÚ¡£ÈçÏÂʾÀýÖ¸¶¨Ò³ÃæÔÚ 1998 Äê 12 Ô 10 ÈÕÉÏÎç 9:00 ·Ö 30 Ãëµ½ÆÚ¡£
¡¡¡¡ < % Response.ExpiresAbsolute=#Dec 12,1998 9:00:30# %>
¶þ¡¢·½·¨
1¡¢Clear
¿ÉÒÔÓà Clear ·½·¨Çå³ý»º³åÇøÖеÄËùÓÐ HTML Êä³ö¡£µ« Clear ·½·¨Ö»Çå³ýÏìÓ¦ÕýÎĶø²»Çå³ýÏìÓ¦±êÌâ¡£¿ÉÒÔÓø÷½·¨´¦Àí´íÎóÇé¿ö¡£µ«ÊÇÈç¹ûûÓн« Response.Buffer ÉèÖÃΪ TRUE£¬Ôò¸Ã·½·¨½«µ¼ÖÂÔËÐÐʱ´íÎó¡£
2¡¢End
End ·½·¨Ê¹ Web ·þÎñÆ÷Í£Ö¹´¦Àí½Å±¾²¢·µ»Øµ±Ç°½á¹û¡£ÎļþÖÐÊ£ÓàµÄÄÚÈݽ«²»±»´¦Àí¡£Èç¹û Response.Buffer ÒÑÉèÖÃΪ TRUE£¬Ôòµ÷Óà Response.End ½«»º³åÊä³ö¡£
3¡¢Flush
Flush ·½·¨Á¢¼´·¢ËÍ»º³åÇøÖеÄÊä³ö¡£Èç¹ûûÓн« Response.Buffer ÉèÖÃΪ TRUE£¬Ôò¸Ã·½·¨½«µ¼ÖÂÔËÐÐʱ´íÎó¡£
4¡¢Redirect
Redirect ·½·¨Ê¹ä¯ÀÀÆ÷Á¢¼´Öض¨Ïòµ½³ÌÐòÖ¸¶¨µÄ URL¡£ÕâÒ²ÊÇÒ»¸öÎÒÃǾ³£Óõ½·½·¨£¬ÕâÑù³ÌÐòÔ±¾Í¿ÉÒÔ¸ù¾Ý¿Í»§µÄ²»Í¬ÏìÓ¦£¬Îª²»Í¬µÄ¿Í»§Ö¸¶¨²»Í¬µÄÒ³Ãæ»ò¸ù¾Ý²»Í¬µÄÇé¿öÖ¸¶¨²»Í¬µÄÒ³Ãæ¡£Ò»µ©Ê¹ÓÃÁË Redirect ·½·¨ÈκÎÔÚÒ³ÖÐÏÔʽÉèÖõÄÏìÓ¦ÕýÎÄÄÚÈݶ¼½«±»ºöÂÔ¡£È»¶ø£¬´Ë·½·¨²»Ïò¿Í»§¶Ë·¢Ë͸ÃÒ³ÉèÖõÄÆäËû HTTP ±êÌ⣬½«²úÉúÒ»¸ö½«Öض¨Ïò URL ×÷ΪÁ´½Ó°üº¬µÄ×Ô¶¯ÏìÓ¦ÕýÎÄ¡£Redirect ·½·¨·¢ËÍÏÂÁÐÏÔʽ±êÌ⣬ÆäÖÐ URL ÊÇ´«µÝ¸ø¸Ã·½·¨µÄÖµ¡£Èç:
¡¡¡¡ < % Response.redirect("www.chinabyte.com") %>
5¡¢Write
Write ·½·¨ÊÇÎÒÃÇƽʱ×î³£Óõķ½·¨Ö®Ò»£¬ËüÊǽ«Ö¸¶¨µÄ×Ö·û´®Ð´µ½µ±Ç°µÄ HTTP Êä³ö¡£
Èý¡¢¼¯ºÏ
Response ¶ÔÏóÖ»ÓÐÒ»¸ö¼¯ºÏ --Cookie
Cookies ¼¯ºÏÉèÖà cookie µÄÖµ¡£ÈôÖ¸¶¨µÄ cookie ²»´æÔÚ£¬Ôò´´½¨Ëü¡£Èô´æÔÚ£¬ÔòÉèÖÃеÄÖµ²¢ÇÒ½«¾Éֵɾȥ¡£
Óï·¨
¡¡¡¡ Response.Cookies(cookie)[(key)|.attribute]=value
ÕâÀïµÄ cookie ÊÇÖ¸¶¨ cookie µÄÃû³Æ¡£¶øÈç¹ûÖ¸¶¨ÁË key£¬Ôò¸Ã cookie ¾ÍÊÇÒ»¸ö×ֵ䡣attribute Ö¸¶¨ cookie ×ÔÉíµÄÓйØÐÅÏ¢¡£attribute ²ÎÊý¿ÉÒÔÊÇÏÂÁÐÖ®Ò» :
Domain Èô±»Ö¸¶¨£¬Ôò cookie ½«±»·¢Ë͵½¶Ô¸ÃÓòµÄÇëÇóÖÐÈ¥¡£
Expires Ö¸¶¨ cookie µÄ¹ýÆÚÈÕÆÚ¡£ÎªÁËÔڻỰ½áÊøºó½« cookie ´æ´¢ÔÚ¿Í»§¶Ë´ÅÅÌÉÏ£¬±ØÐëÉèÖøÃÈÕÆÚ¡£Èô´ËÏîÊôÐÔµÄÉèÖÃ䳬¹ýµ±Ç°ÈÕÆÚ£¬ÔòÔÚÈÎÎñ½áÊøºó cookie ½«µ½ÆÚ¡£
HasKeys Ö¸¶¨ cookie ÊÇ·ñ°üº¬¹Ø¼ü×Ö¡£
Path Èô±»Ö¸¶¨£¬Ôò cookie ½«Ö»·¢Ë͵½¶Ô¸Ã·¾¶µÄÇëÇóÖС£Èç¹ûδÉèÖøÃÊôÐÔ£¬ÔòʹÓÃÓ¦ÓóÌÐòµÄ·¾¶¡£
ÖÁ´Ë£¬ÎÒÃÇÒѾѧϰµÄ Response ¶ÔÏóµÄËùÓÐÊôÐÔ¡¢·½·¨ºÍ¼¯ºÏµÄÀíÂÛ֪ʶ£¬ÏÂÃæ×÷Õß½«¸ø´ó¼ÒÑÝʾһ¶Î¼òµ¥µÄ³ÌÐò£¬Í¨¹ýʵ¼ùÈôó¼Ò¼ÓÉîÀí½â¡£ÏȽ«ÒÔϳÌÐò¼ôÌùµ½¼Çʲ¾ÖУ¬²¢±£´***ª asp7.asp¡£( ×¢Ò⽫ < ºÍ % Ö®¼äµÄ¿Õ¸ñÈ¥µô !!!)
¡¡¡¡< %
¡¡¡¡Dim user
Dim flag
Dim pwd
¡¡¡¡Dim say
Response.buffer=true \\\' ¿ªÆô»º³åÒ³Ã湦ÄÜ
Response.ContentType="text/HTML"
¡¡¡¡Response.Charset="gb2312"
¡¡¡¡user=Request.Form("username")
pwd=Request.Form("password")
say=Request.QueryString("say")
%>
¡¡¡¡< form method="POST" action="asp7.asp">
¡¡¡¡< p>Óû§Ãû :< input type="text" name="username" size="12">< br>
¡¡¡¡¿Ú Áî :< input type="password" name="password" size="12">< br>
¡¡¡¡< input type="submit" value=" Ìá½» " name="B1">< input type="reset" value=" È¡Ïû " name="B2">< /p>< /form>
¡¡¡¡< %
¡¡¡¡If say=1 then
¡¡¡¡Response.Write " »¶ÓÊéÉú´ó¼Ý¹âÁÙ !"
End If
¡¡¡¡If say >1 then
¡¡¡¡Response.Write " »¶ÓÔٴιâÁÙÊéÉúµÄ ASP ÍøÕ¾ !"
End If
¡¡¡¡If user="Adm" and pwd="shusheng" Then
¡¡¡¡Response.Expires=1 \\\' ÉèÖøÃÒ³ÃæÔÚä¯ÀÀÆ÷µÄ»º³åÖд洢 1 ·ÖÖÓºó¹ýÆÚ¡£
¡¡¡¡flag=1
¡¡¡¡ElseIf user="guest" and pwd="guest" Then
¡¡¡¡Response.Expires=0 \\\' ʹ»º´æµÄÒ³ÃæÁ¢¼´¹ýÆÚ¡£
¡¡¡¡Response.Clear \\\' Çå¿Õ´æ´¢ÔÚ»º´æÖеÄÒ³Ãæ
¡¡¡¡flag=2
¡¡¡¡ElseIf user="vip" and pwd="vip" Then
¡¡¡¡Response.Write " »¶Ó VIP ¹âÁÙÊéÉúµÄ ASP ÍøÕ¾ "
¡¡¡¡flag=3
¡¡¡¡Else
¡¡¡¡flag=0
¡¡¡¡Response.End \\\' Á¢¼´Í£Ö¹½Å±¾´¦Àí£¬²¢½«»º´æÖеÄÒ³ÃæÊä³ö
End If
¡¡¡¡Response.write "< p>< a href=\\\'asp7b.asp?flag="&flag&"\\\'>¶¯Ì¬ÍøÕ¾Éè¼ÆÊ®°Ë°ãÎäÒÕ --ASP ƪ (7) ʵ¼ùÁ·Ï° < /a>< /p>"
\\\' ½«±äÁ¿ flag µÄÖµ´«Ë͸ø asp7b.asp
¡¡¡¡%>
¡¡¡¡< p>¶¯Ì¬ÍøÕ¾Éè¼ÆÊ®°Ë°ãÎäÒÕ --ASP ƪ (7) ʵ¼ùÁ·Ï° < /p>
¡¡¡¡ ÔÙ½«ÒÔϳÌÐò±£´***ª asp7b.asp¡£
¡¡¡¡< %
¡¡¡¡Dim saysay=Request.QueryString("flag")
Select case say
¡¡¡¡case "1"
¡¡¡¡Response.Redirect "asp7.asp?say=1"
case "2"
¡¡¡¡Response.Redirect "asp7.asp?say=2"
case "3"
¡¡¡¡Response.Redirect "asp7.asp?say=3"
case "0"
¡¡¡¡Response.Redirect "asp7.asp?say=0"
End Select
¡¡¡¡%>
½«ÕâÁ½¸ö³ÌÐò·ÅÔÚÓÐÖ´ÐÐȨÏÞµÄ WEB ÐéÄâĿ¼Ï£¬²¢ÒÔ http ·½Ê½·ÃÎÊ asp7.asp¡£ÔÚÕâÁ½¸ö³ÌÐòÖÐÎÒÃdzä·ÖÔËÓÃÁËÖÁ½ñΪֹËùѧ¹ýµÄÁ½¸ö ASP ÄÚ½¨¶ÔÏó :Request ºÍ Response¡£µ±ÄãµÚÒ»´Î·ÃÎÊ asp7.asp Îļþʱ£¬Ò³ÃæÉϳöÏÖÒ»¸ö Form ²¢ÌáʾÊäÈëÓû§ÃûºÍ¿ÚÁÈç¹ûÄãÊäÈëÓû§Ãû :Adm¡¢¿ÚÁî :shusheng, Ôò»á³öÏÖÈçÏÂÒ³Ãæ :
Èç¹ûÄãÊäÈëÓû§Ãû :guest¡¢¿ÚÁî :guest, Ôò½ö³öÏÖÈçÏÂÒ³Ãæ :
ÕâÊÇΪʲôÄØ£¿ÒòΪÎÒÃÇÉèÖÃÁËÒ³Ã滺´æ£¬µ±Ê¹Óà guest µÇ½ʱ£¬ÅжϳÌÐò×Ô¶¯Çå¿ÕÆä֮ǰËùÓд洢ÔÚ»º´æÖеÄÒ³Ã棬¶ø½ö½«Æäºó½Å±¾³ÌÐòÖ´ÐеĽá¹ûÏÔʾ³öÀ´¡£
ÄÇΪʲôµÚÒ»´ÎµÇ½ asp7.asp Ò³Ãæʱ½ö½öÖ»ÏÔʾһ¸ö Form ¶Ô»°¿òÄØ£¿ÒòΪ´Ëʱ³ÌÐòÅжϵ½Óû§¼È·Ç Adm, Ò²²»ÊÇ guest ºÍ vip£¬ËùÒÔÖ´ÐÐ Response.End, Á¢¼´½«´æ´¢ÔÚ»º´æÖÐµÄ Form ÏÔʾ³öÀ´£¬²¢Í£Ö¹ÆäºóµÄÒ»Çнű¾´¦Àí£¬°üÀ¨´¿ HTML ´úÂëµÄÏÔʾ¡£
ÎÞÂÛÄãÊÇÓà Adm »¹ÊÇ guest »ò vip µÇ½¸ÃÒ³ÃæÄ㶼¿ÉÒÔ¿´µ½Ò»¸ö³¬Á´£¬¸Ã³¬Á´Ö¸ÏòÎļþ asp7b.asp£¬µ±ÎÒÃǵã»÷¸Ã³¬Á´Ê±£¬asp7.asp ½«±äÁ¿ flag µÄÖµ×÷Ϊ²ÎÊý·¢Ë͸ø asp7b.asp, ¶øºóÕßÔò¸ù¾Ý¸Ã²ÎÊýµÄÖµÀ´×ö³öÅжϣ¬²¢ÒÀ¾Ý²»Í¬Çé¿öʹÓà Response.Redirect ÔÙÇ¿Ðзµ»Ø asp7.asp, ²¢Ò²½«Ò»¸ö±äÁ¿ say µÄÖµ×÷Ϊ²ÎÊý·¢Ë͸ø asp7.asp¡£Èç´ËÒ»À´£¬asp7.asp ÓÖ»á¸ù¾Ý´Ë²ÎÊýÀ´×ö³ö²»Í¬µÄ·´Ó¦¡£
´ó¼ÒÏÖÔÚ¶¼¿´µ½ÁËÎÒÃǽö½öÓÃÁËÁ½¸öºÜ¼òµ¥µÄ³ÌÐò£¬¾Í¿ÉÒÔ×öµ½¶Ôͬһ¸öÒ³ÃæµÄ¶àÖÖ²»Í¬ÏÔʾ½á¹û£¬ÕâÕýÊÇ ASP µÄ÷ÈÁ¦ËùÔÚ£¬¸÷λ¿ÉÒÔÒÔ´Ëʾ·¶³ÌÐòΪ»ù´¡£¬À´½øÐÐһЩ¸Ä¶¯£¬ÒÔÊìÁ·ÕÆÎÕÎÒÃÇËùѧµÄÕâÁ½¸öÄÚ½¨¶ÔÏó¡£
×î½ü£¬ÓкܶàÅóÓÑÀ´¡°Ãöù¡±´ßÎÒ¼Ó¿ì ASP ƪһÎĵÄд×÷Ëٶȣ¬²¢¼±ÇеØѯÎÊÄÄÀïÓйØÓÚ ASP µÄ½Ì²Ä¡£ÎÒÉîÉîµØ±»´ó¼ÒµÄѧϰÈÈÇéËù´ò¶¯£¬Òò´Ë¾ö¶¨½«×Ô¼ºÆ½Ê±ËùËѼ¯µÄһЩ ASP ÐÅÏ¢×ÊÁÏÄóöÀ´ºÍ´ó¼Ò¹²Ïí£¬Ò²Ï£ÍûËùÓеÄÅóÓÑÄÜ¿¶¿®µØ½«×Ô¼ºËѼ¯µÄÓÐ¹Ø ASP µÄ×ÊÁϸæËß×÷Õߣ¬Ð»Ð»¡£ÓÉÓÚÄ¿Ç°¹úÄÚÓÐ¹Ø ASP µÄÖÐÎĽ̲ķïë÷ë½Ç£¬¶øרÃÅÕë¶Ô ASP ÍøÕ¾¿ª·¢µÄÖÐÎĽ̲Ä×÷Õ߸üÊÇÎÅËùδÎÅ£¨¿ÉÄÜÊÇ×÷Õ߹ª¹ÑÎÅ£©£¬Ö»ÊÇ×î½üÌý˵³öÁËÒ»±¾Ç廪´óѧ³ö°æÉç³ö°æµÄ¹ØÓÚ MS InterDev µÄɵ¹ÏÊ飬ÆäÖÐÓÐ ASP µÄ½Ìѧ£¬ºÍÒ»±¾ Active Server Page 2.0 µÄÖÐÎÄÊֲᣬÒò´ËÄ¿Ç°×÷Õß»¹ÊÇÖ÷Ҫͨ¹ý¹úÍâÍøÕ¾À´»ñÈ¡ ASP µÄÓйØÐÅÏ¢ºÍ×ÊÁÏ£¬ÕâÒ²ÊÇ×÷Õßд±¾ÎĵÄÒ»¸öÖ÷ÒªÔÒò¡£ÏÂÃ***Ҿͽ« bookmark ÖеÄһЩ½Ï¾µäµÄ ASP Õ¾µãÂÞÁгöÀ´£º
1¡¢http://www.activeserverpage.com/
ÕâÊÇ×÷Õß·ÃÎÊ×îƵ·±µÄ ASP ÍøÕ¾£¬Ò²ÊÇÊÀ½çÉÏ×î´ó×îÈ«µÄ¹ØÓÚ ASP µÄÍøÕ¾Ö®Ò»£¬ËüÀïÃæ²»µ«ÓÐ×îÐ嵀 ASP ÎÄÏ××ÊÁÏ£¬Ãâ·Ñ×é¼þ£¬»¹ÓÐÒ»±¾ÍêÕûµÄ ASP ÈëÃŽ̲ģ¬Ëü¸üÊÇ ASP ÍøÕ¾µÄÖÐÊàÕ¾µã£¬Í¨¹ýËüÄã¿ÉÒÔµ½´ïÎÞÊýµÄ ASP Ïà¹ØÕ¾µã¡£
2¡¢http://www.asphole.com/
Õâ±¾ÊÇÒ»¸öÕë¶Ô ASP ©¶´¶ø½¨Á¢µÄÕ¾µã£¬µ«ÊÇËüÈ´ÎÞÒÉÊÇÒ»¸öÍ걸µÄ ASP ÐÅÏ¢Õ¾µã£¬Ëü·Çµ«ÌṩÁË ASP µÄÎÄÕ£¬¼°×é¼þ»¹ÌṩÏ꾡͸³¹µÄÁª½ÓµØÖ·¡£
3¡¢http://www.15seconds.com/faq ºÍ http://www.15seconds.com/search
ÕâÊÇÒ»¸ö×÷ÕßËù¿´µ½µÄ×î´óµÄÍøÉÏ ASP ½»Á÷Õ¾µã£¬ËüÓµÓÐ ASP ½âÒɵĴ𰸣¬ASP ÓʼþÇåµ¥ÐÅÏ¢£¬ASP ¼¼ÇÉ£¬Äã¿ÉÄÜÐèÒªÐèÒª¼¸¸öÔµÄʱ¼ä²ÅÄܶÁÍêÕâЩÐÅÏ¢¡£¶øÔÚ http://www.15seconds.com/AllComponents.asp Äã¿ÉÒÔ¶Áµ½×îÐ嵀 ActiveX ×é¼þºÍ´óÁ¿Ãâ·Ñ×é¼þµÄÏêϸ½éÉÜ£¬²¢¸½Óзdz£ÊµÓõÄÎĵµÓëÀý×Ó¡£
4¡¢http://www.microsoft.com/workshop/server/asp/aspfeat.asp
´ó¼Ò¶¼ÖªµÀ Active Server Page ÊÇ΢ÈíÌá³öµÄÒ»Ì×»ùÓÚ NT IIS µÄ WEB ·þÎñÆ÷¶Ë»·¾³£¬ÄÇôÕâ¸öÓÉ΢Èí×Ô¼º½¨Á¢µÄ ASP ¼¼Êõ˵Ã÷Õ¾µã£¬´ó¼Òµ±È»ÊDz»¿É²»¿´µÄ¡£
5¡¢http://www.serverobjects.com/
ÔÚÕâÀïÄã¿ÉÒÔ»ñµÃÎÞÊýʵÓÃµÄ ActiveX ×é¼þ , ²¢ÏÂÔØËüÃǵÄÊÔÓð棬ֻ¿ÉϧÆäÖеĴ󲿷ּ«ºÃµÄ×é¼þ¶¼ÊÇÒª Money µÄ¡£
6¡¢http://www.cyscape.com/asp/browscap/
´ó¼Ò»¹¼ÇµÃ×÷ÕßÔÚ ASP2 Ò»ÎÄÖнéÉܵÄÄǸöÓÃÀ´±æ±ð¿Í»§¶Ëä¯ÀÀÆ÷°æ±¾µÄ Browser Capabilitie ×é¼þÂð£¿ÔÚÕâ¸öÕ¾µãÄã¿ÉÒÔ»ñµÃ×îÐ嵀 BROWSCAP.INI Îļþ£¬ËüÓµÓÐÿһ¸ö ASP °²×°Ê±Î¢ÈíûÓÐÌṩµÄä¯ÀÀÆ÷µÄÐÅÏ¢£¬ÕâÑùÄãÔÚ ASP ÖÐÅжϿͻ§ä¯ÀÀÆ÷ÊǾÍÄܹ»ÍòÎÞһʧÁË¡£
7¡¢http://www.microsoft.com/data/ado/
ASP ×îÇ¿´óÇÒ±ã½ÝµÄ¹¦ÄÜĪ¹ýÓÚͬÊý¾Ý¿âµÄÁ¬½Ó£¬Í¨¹ý ASP ÄÚ½¨µÄ ActiveX ×é¼þ£¬ÎÒÃÇ¿ÉÒÔÇá¶øÒ׾ٵĽ« WEB ÓëËùÓÐºÍ ODBC ¼æÈݵÄÊý¾Ý¿âÁ¬½ÓÆðÀ´£¬ÔÚÕâ¸ö΢ÈíµÄÕ¾µãÉÏÄã¿ÉÒÔ»ñÈ¡ºÜ¶àʵÓÃµÄ ADO ×ÊÁÏ¡£
8¡¢http://www.cobb.com/m_sbn4/
Ò»¸ö²»´íµÄ ASP ÂÛ̳£¬Äã¿ÉÒÔÔÚÄÇÀïÌùÄãµÄÎÊÌ⣬¶ÁÈ¡±ðÈ˵ÄÎÊÌâºÍ½â´ð¡£
ÏÂÃ棬ÎÒÃÇ¿ªÊ¼Ñ§Ï° ASP µÄÁíÒ»¸öÄÚ½¨¶ÔÏó Response¡£
Óë Request ÊÇ»ñÈ¡¿Í»§¶Ë HTTP ÐÅÏ¢Ïà·´ ,Response ¶ÔÏóÊÇÓÃÀ´¿ØÖÆ·¢Ë͸øÓû§µÄÐÅÏ¢£¬°üÀ¨Ö±½Ó·¢ËÍÐÅÏ¢¸øä¯ÀÀÆ÷¡¢Öض¨Ïòä¯ÀÀÆ÷µ½ÁíÒ»¸ö URL »òÉèÖà cookie µÄÖµ¡£
Óï·¨
Response.collection|property|method
Ò»¡¢ÊôÐÔ
1¡¢Buffer
Buffer ÊôÐÔָʾÊÇ·ñ»º³åÒ³Êä³ö¡£µ±»º³åÒ³Êä³öʱ£¬Ö»Óе±Ç°Ò³µÄËùÓзþÎñÆ÷½Å±¾´¦ÀíÍê±Ï»òÕßµ÷ÓÃÁË Flush »ò End ·½·¨ºó£¬·þÎñÆ÷²Å½«ÏìÓ¦·¢Ë͸ø¿Í»§¶Ëä¯ÀÀÆ÷£¬·þÎñÆ÷½«Êä³ö·¢Ë͸ø¿Í»§¶Ëä¯ÀÀÆ÷ºó¾Í²»ÄÜÔÙÉèÖà Buffer ÊôÐÔ¡£Òò´ËÓ¦¸ÃÔÚ .asp ÎļþµÄµÚÒ»Ðе÷Óà Response.Buffer¡£
2¡¢Charset
Charset ÊôÐÔ½«×Ö·û¼¯Ãû³Æ¸½¼Óµ½ Response ¶ÔÏóÖÐ content-type ±êÌâµÄºóÃæ¡£¶ÔÓÚ²»°üº¬ Response.Charset ÊôÐ﵀ ASP Ò³£¬content-type ±êÌ⽫Ϊ :content-type:text/html¡£
ÎÒÃÇ¿ÉÒÔÔÚ .asp ÎļþÖÐÖ¸¶¨ content-type ±êÌ⣬Èç :
¡¡¡¡ < % Response.Charset="gb2312") %>
½«²úÉúÒÔϽá¹û :
¡¡¡¡ content-type:text/html; charset=gb2312
×¢Ò⣬ÎÞÂÛ×Ö·û´®±íʾµÄ×Ö·û¼¯ÊÇ·ñÓÐЧ£¬¸Ã¹¦Äܶ¼»á½«Æä²åÈë content-type ±êÌâÖС£ÇÒÈç¹ûij¸öÒ³°üº¬¶à¸öº¬ÓÐ Response.Charset µÄ±ê¼Ç£¬Ôòÿ¸ö Response.Charset ¶¼½«Ìæ´úÇ°Ò»¸ö CharsetName¡£ÕâÑù£¬×Ö·û¼¯½«±»ÉèÖÃΪ¸ÃÒ³ÖÐ Response.Charset µÄ×îºóÒ»¸öʵÀýËùÖ¸¶¨Öµ¡£
3¡¢ContentType
ContentType ÊôÐÔÖ¸¶¨·þÎñÆ÷ÏìÓ¦µÄ HTTP ÄÚÈÝÀàÐÍ¡£Èç¹ûδָ¶¨ ContentType£¬Ä¬ÈÏΪ text/HTML¡£
4¡¢Expires
Expires ÊôÐÔÖ¸¶¨ÁËÔÚä¯ÀÀÆ÷ÉÏ»º³å´æ´¢µÄÒ³¾à¹ýÆÚ»¹ÓжàÉÙʱ¼ä¡£Èç¹ûÓû§ÔÚij¸öÒ³¹ýÆÚ֮ǰÓֻص½´ËÒ³£¬¾Í»áÏÔʾ»º³åÇøÖеÄÒ³Ãæ¡£Èç¹ûÉèÖà response.expires=0£¬Ôò¿Éʹ»º´æµÄÒ³ÃæÁ¢¼´¹ýÆÚ¡£ÕâÊÇÒ»¸ö½ÏʵÓõÄÊôÐÔ£¬µ±¿Í»§Í¨¹ý ASP µÄµÇ½ҳÃæ½øÈë WEB Õ¾µãºó£¬Ó¦¸ÃÀûÓøÃÊôÐÔʹµÇ½ҳÃæÁ¢¼´¹ýÆÚ£¬ÒÔÈ·±£°²È«¡£
5¡¢ExpiresAbsolute
Óë Expires ÊôÐÔ²»Í¬ ExpiresAbsolute ÊôÐÔÖ¸¶¨»º´æÓÚä¯ÀÀÆ÷ÖеÄÒ³ÃæµÄÈ·Çе½ÆÚÈÕÆÚºÍʱ¼ä¡£ÔÚδµ½ÆÚ֮ǰ£¬ÈôÓû§·µ»Øµ½¸ÃÒ³£¬¸Ã»º´æÖеÄÒ³Ãæ¾ÍÏÔʾ¡£Èç¹ûδָ¶¨Ê±¼ä£¬¸ÃÖ÷Ò³ÔÚµ±ÌìÎçÒ¹µ½ÆÚ¡£Èç¹ûδָ¶¨ÈÕÆÚ£¬Ôò¸ÃÖ÷Ò³Ôڽű¾ÔËÐе±ÌìµÄÖ¸¶¨Ê±¼äµ½ÆÚ¡£ÈçÏÂʾÀýÖ¸¶¨Ò³ÃæÔÚ 1998 Äê 12 Ô 10 ÈÕÉÏÎç 9:00 ·Ö 30 Ãëµ½ÆÚ¡£
¡¡¡¡ < % Response.ExpiresAbsolute=#Dec 12,1998 9:00:30# %>
¶þ¡¢·½·¨
1¡¢Clear
¿ÉÒÔÓà Clear ·½·¨Çå³ý»º³åÇøÖеÄËùÓÐ HTML Êä³ö¡£µ« Clear ·½·¨Ö»Çå³ýÏìÓ¦ÕýÎĶø²»Çå³ýÏìÓ¦±êÌâ¡£¿ÉÒÔÓø÷½·¨´¦Àí´íÎóÇé¿ö¡£µ«ÊÇÈç¹ûûÓн« Response.Buffer ÉèÖÃΪ TRUE£¬Ôò¸Ã·½·¨½«µ¼ÖÂÔËÐÐʱ´íÎó¡£
2¡¢End
End ·½·¨Ê¹ Web ·þÎñÆ÷Í£Ö¹´¦Àí½Å±¾²¢·µ»Øµ±Ç°½á¹û¡£ÎļþÖÐÊ£ÓàµÄÄÚÈݽ«²»±»´¦Àí¡£Èç¹û Response.Buffer ÒÑÉèÖÃΪ TRUE£¬Ôòµ÷Óà Response.End ½«»º³åÊä³ö¡£
3¡¢Flush
Flush ·½·¨Á¢¼´·¢ËÍ»º³åÇøÖеÄÊä³ö¡£Èç¹ûûÓн« Response.Buffer ÉèÖÃΪ TRUE£¬Ôò¸Ã·½·¨½«µ¼ÖÂÔËÐÐʱ´íÎó¡£
4¡¢Redirect
Redirect ·½·¨Ê¹ä¯ÀÀÆ÷Á¢¼´Öض¨Ïòµ½³ÌÐòÖ¸¶¨µÄ URL¡£ÕâÒ²ÊÇÒ»¸öÎÒÃǾ³£Óõ½·½·¨£¬ÕâÑù³ÌÐòÔ±¾Í¿ÉÒÔ¸ù¾Ý¿Í»§µÄ²»Í¬ÏìÓ¦£¬Îª²»Í¬µÄ¿Í»§Ö¸¶¨²»Í¬µÄÒ³Ãæ»ò¸ù¾Ý²»Í¬µÄÇé¿öÖ¸¶¨²»Í¬µÄÒ³Ãæ¡£Ò»µ©Ê¹ÓÃÁË Redirect ·½·¨ÈκÎÔÚÒ³ÖÐÏÔʽÉèÖõÄÏìÓ¦ÕýÎÄÄÚÈݶ¼½«±»ºöÂÔ¡£È»¶ø£¬´Ë·½·¨²»Ïò¿Í»§¶Ë·¢Ë͸ÃÒ³ÉèÖõÄÆäËû HTTP ±êÌ⣬½«²úÉúÒ»¸ö½«Öض¨Ïò URL ×÷ΪÁ´½Ó°üº¬µÄ×Ô¶¯ÏìÓ¦ÕýÎÄ¡£Redirect ·½·¨·¢ËÍÏÂÁÐÏÔʽ±êÌ⣬ÆäÖÐ URL ÊÇ´«µÝ¸ø¸Ã·½·¨µÄÖµ¡£Èç:
¡¡¡¡ < % Response.redirect("www.chinabyte.com") %>
5¡¢Write
Write ·½·¨ÊÇÎÒÃÇƽʱ×î³£Óõķ½·¨Ö®Ò»£¬ËüÊǽ«Ö¸¶¨µÄ×Ö·û´®Ð´µ½µ±Ç°µÄ HTTP Êä³ö¡£
Èý¡¢¼¯ºÏ
Response ¶ÔÏóÖ»ÓÐÒ»¸ö¼¯ºÏ --Cookie
Cookies ¼¯ºÏÉèÖà cookie µÄÖµ¡£ÈôÖ¸¶¨µÄ cookie ²»´æÔÚ£¬Ôò´´½¨Ëü¡£Èô´æÔÚ£¬ÔòÉèÖÃеÄÖµ²¢ÇÒ½«¾Éֵɾȥ¡£
Óï·¨
¡¡¡¡ Response.Cookies(cookie)[(key)|.attribute]=value
ÕâÀïµÄ cookie ÊÇÖ¸¶¨ cookie µÄÃû³Æ¡£¶øÈç¹ûÖ¸¶¨ÁË key£¬Ôò¸Ã cookie ¾ÍÊÇÒ»¸ö×ֵ䡣attribute Ö¸¶¨ cookie ×ÔÉíµÄÓйØÐÅÏ¢¡£attribute ²ÎÊý¿ÉÒÔÊÇÏÂÁÐÖ®Ò» :
Domain Èô±»Ö¸¶¨£¬Ôò cookie ½«±»·¢Ë͵½¶Ô¸ÃÓòµÄÇëÇóÖÐÈ¥¡£
Expires Ö¸¶¨ cookie µÄ¹ýÆÚÈÕÆÚ¡£ÎªÁËÔڻỰ½áÊøºó½« cookie ´æ´¢ÔÚ¿Í»§¶Ë´ÅÅÌÉÏ£¬±ØÐëÉèÖøÃÈÕÆÚ¡£Èô´ËÏîÊôÐÔµÄÉèÖÃ䳬¹ýµ±Ç°ÈÕÆÚ£¬ÔòÔÚÈÎÎñ½áÊøºó cookie ½«µ½ÆÚ¡£
HasKeys Ö¸¶¨ cookie ÊÇ·ñ°üº¬¹Ø¼ü×Ö¡£
Path Èô±»Ö¸¶¨£¬Ôò cookie ½«Ö»·¢Ë͵½¶Ô¸Ã·¾¶µÄÇëÇóÖС£Èç¹ûδÉèÖøÃÊôÐÔ£¬ÔòʹÓÃÓ¦ÓóÌÐòµÄ·¾¶¡£
ÖÁ´Ë£¬ÎÒÃÇÒѾѧϰµÄ Response ¶ÔÏóµÄËùÓÐÊôÐÔ¡¢·½·¨ºÍ¼¯ºÏµÄÀíÂÛ֪ʶ£¬ÏÂÃæ×÷Õß½«¸ø´ó¼ÒÑÝʾһ¶Î¼òµ¥µÄ³ÌÐò£¬Í¨¹ýʵ¼ùÈôó¼Ò¼ÓÉîÀí½â¡£ÏȽ«ÒÔϳÌÐò¼ôÌùµ½¼Çʲ¾ÖУ¬²¢±£´***ª asp7.asp¡£( ×¢Ò⽫ < ºÍ % Ö®¼äµÄ¿Õ¸ñÈ¥µô !!!)
¡¡¡¡< %
¡¡¡¡Dim user
Dim flag
Dim pwd
¡¡¡¡Dim say
Response.buffer=true \\\' ¿ªÆô»º³åÒ³Ã湦ÄÜ
Response.ContentType="text/HTML"
¡¡¡¡Response.Charset="gb2312"
¡¡¡¡user=Request.Form("username")
pwd=Request.Form("password")
say=Request.QueryString("say")
%>
¡¡¡¡< form method="POST" action="asp7.asp">
¡¡¡¡< p>Óû§Ãû :< input type="text" name="username" size="12">< br>
¡¡¡¡¿Ú Áî :< input type="password" name="password" size="12">< br>
¡¡¡¡< input type="submit" value=" Ìá½» " name="B1">< input type="reset" value=" È¡Ïû " name="B2">< /p>< /form>
¡¡¡¡< %
¡¡¡¡If say=1 then
¡¡¡¡Response.Write " »¶ÓÊéÉú´ó¼Ý¹âÁÙ !"
End If
¡¡¡¡If say >1 then
¡¡¡¡Response.Write " »¶ÓÔٴιâÁÙÊéÉúµÄ ASP ÍøÕ¾ !"
End If
¡¡¡¡If user="Adm" and pwd="shusheng" Then
¡¡¡¡Response.Expires=1 \\\' ÉèÖøÃÒ³ÃæÔÚä¯ÀÀÆ÷µÄ»º³åÖд洢 1 ·ÖÖÓºó¹ýÆÚ¡£
¡¡¡¡flag=1
¡¡¡¡ElseIf user="guest" and pwd="guest" Then
¡¡¡¡Response.Expires=0 \\\' ʹ»º´æµÄÒ³ÃæÁ¢¼´¹ýÆÚ¡£
¡¡¡¡Response.Clear \\\' Çå¿Õ´æ´¢ÔÚ»º´æÖеÄÒ³Ãæ
¡¡¡¡flag=2
¡¡¡¡ElseIf user="vip" and pwd="vip" Then
¡¡¡¡Response.Write " »¶Ó VIP ¹âÁÙÊéÉúµÄ ASP ÍøÕ¾ "
¡¡¡¡flag=3
¡¡¡¡Else
¡¡¡¡flag=0
¡¡¡¡Response.End \\\' Á¢¼´Í£Ö¹½Å±¾´¦Àí£¬²¢½«»º´æÖеÄÒ³ÃæÊä³ö
End If
¡¡¡¡Response.write "< p>< a href=\\\'asp7b.asp?flag="&flag&"\\\'>¶¯Ì¬ÍøÕ¾Éè¼ÆÊ®°Ë°ãÎäÒÕ --ASP ƪ (7) ʵ¼ùÁ·Ï° < /a>< /p>"
\\\' ½«±äÁ¿ flag µÄÖµ´«Ë͸ø asp7b.asp
¡¡¡¡%>
¡¡¡¡< p>¶¯Ì¬ÍøÕ¾Éè¼ÆÊ®°Ë°ãÎäÒÕ --ASP ƪ (7) ʵ¼ùÁ·Ï° < /p>
¡¡¡¡ ÔÙ½«ÒÔϳÌÐò±£´***ª asp7b.asp¡£
¡¡¡¡< %
¡¡¡¡Dim saysay=Request.QueryString("flag")
Select case say
¡¡¡¡case "1"
¡¡¡¡Response.Redirect "asp7.asp?say=1"
case "2"
¡¡¡¡Response.Redirect "asp7.asp?say=2"
case "3"
¡¡¡¡Response.Redirect "asp7.asp?say=3"
case "0"
¡¡¡¡Response.Redirect "asp7.asp?say=0"
End Select
¡¡¡¡%>
½«ÕâÁ½¸ö³ÌÐò·ÅÔÚÓÐÖ´ÐÐȨÏÞµÄ WEB ÐéÄâĿ¼Ï£¬²¢ÒÔ http ·½Ê½·ÃÎÊ asp7.asp¡£ÔÚÕâÁ½¸ö³ÌÐòÖÐÎÒÃdzä·ÖÔËÓÃÁËÖÁ½ñΪֹËùѧ¹ýµÄÁ½¸ö ASP ÄÚ½¨¶ÔÏó :Request ºÍ Response¡£µ±ÄãµÚÒ»´Î·ÃÎÊ asp7.asp Îļþʱ£¬Ò³ÃæÉϳöÏÖÒ»¸ö Form ²¢ÌáʾÊäÈëÓû§ÃûºÍ¿ÚÁÈç¹ûÄãÊäÈëÓû§Ãû :Adm¡¢¿ÚÁî :shusheng, Ôò»á³öÏÖÈçÏÂÒ³Ãæ :
Èç¹ûÄãÊäÈëÓû§Ãû :guest¡¢¿ÚÁî :guest, Ôò½ö³öÏÖÈçÏÂÒ³Ãæ :
ÕâÊÇΪʲôÄØ£¿ÒòΪÎÒÃÇÉèÖÃÁËÒ³Ã滺´æ£¬µ±Ê¹Óà guest µÇ½ʱ£¬ÅжϳÌÐò×Ô¶¯Çå¿ÕÆä֮ǰËùÓд洢ÔÚ»º´æÖеÄÒ³Ã棬¶ø½ö½«Æäºó½Å±¾³ÌÐòÖ´ÐеĽá¹ûÏÔʾ³öÀ´¡£
ÄÇΪʲôµÚÒ»´ÎµÇ½ asp7.asp Ò³Ãæʱ½ö½öÖ»ÏÔʾһ¸ö Form ¶Ô»°¿òÄØ£¿ÒòΪ´Ëʱ³ÌÐòÅжϵ½Óû§¼È·Ç Adm, Ò²²»ÊÇ guest ºÍ vip£¬ËùÒÔÖ´ÐÐ Response.End, Á¢¼´½«´æ´¢ÔÚ»º´æÖÐµÄ Form ÏÔʾ³öÀ´£¬²¢Í£Ö¹ÆäºóµÄÒ»Çнű¾´¦Àí£¬°üÀ¨´¿ HTML ´úÂëµÄÏÔʾ¡£
ÎÞÂÛÄãÊÇÓà Adm »¹ÊÇ guest »ò vip µÇ½¸ÃÒ³ÃæÄ㶼¿ÉÒÔ¿´µ½Ò»¸ö³¬Á´£¬¸Ã³¬Á´Ö¸ÏòÎļþ asp7b.asp£¬µ±ÎÒÃǵã»÷¸Ã³¬Á´Ê±£¬asp7.asp ½«±äÁ¿ flag µÄÖµ×÷Ϊ²ÎÊý·¢Ë͸ø asp7b.asp, ¶øºóÕßÔò¸ù¾Ý¸Ã²ÎÊýµÄÖµÀ´×ö³öÅжϣ¬²¢ÒÀ¾Ý²»Í¬Çé¿öʹÓà Response.Redirect ÔÙÇ¿Ðзµ»Ø asp7.asp, ²¢Ò²½«Ò»¸ö±äÁ¿ say µÄÖµ×÷Ϊ²ÎÊý·¢Ë͸ø asp7.asp¡£Èç´ËÒ»À´£¬asp7.asp ÓÖ»á¸ù¾Ý´Ë²ÎÊýÀ´×ö³ö²»Í¬µÄ·´Ó¦¡£
´ó¼ÒÏÖÔÚ¶¼¿´µ½ÁËÎÒÃǽö½öÓÃÁËÁ½¸öºÜ¼òµ¥µÄ³ÌÐò£¬¾Í¿ÉÒÔ×öµ½¶Ôͬһ¸öÒ³ÃæµÄ¶àÖÖ²»Í¬ÏÔʾ½á¹û£¬ÕâÕýÊÇ ASP µÄ÷ÈÁ¦ËùÔÚ£¬¸÷λ¿ÉÒÔÒÔ´Ëʾ·¶³ÌÐòΪ»ù´¡£¬À´½øÐÐһЩ¸Ä¶¯£¬ÒÔÊìÁ·ÕÆÎÕÎÒÃÇËùѧµÄÕâÁ½¸öÄÚ½¨¶ÔÏó¡£
zy_sunshine- Éϵȱø
- Ìû×ÓÊý : 47
×¢²áÈÕÆÚ : 08-03-19
µÚ1Ò³/¹²1Ò³
ÄúÔÚÕâ¸öÂÛ̳µÄȨÏÞ£º
Äú²»ÄÜÔÚÕâ¸öÂÛ̳»Ø¸´Ö÷Ìâ