ASP.NETÒ³Ãæ¶ÔÏó
»ñÈ¡ ASP.NET ÌṩµÄµ±Ç° Session ¶ÔÏó ( HttpSessionState Àà )¡£¸ÃÊôÐÔÌṩÓйص±Ç°ÇëÇóµÄ»á»°µÄÐÅÏ¢¡£Îª´Ó ASP.NET Ó¦ÓóÌÐòÇëÇóÒ³»òÎĵµµÄÿ¸öÓû§Î¬»¤Ò»¸ö Session ¶ÔÏó¡£µ±Óû§ÔÚÓ¦ÓóÌÐòÖдÓÒ»Ò³Òƶ¯µ½Áíһҳʱ£¬´æ´¢ÔÚ Session ¶ÔÏóÖеıäÁ¿²»»á±»·ÅÆú£»Ïà·´£¬Ö»ÒªÓû§ÔÚÓ¦ÓóÌÐòÖзÃÎÊÒ³£¬ÕâЩ±äÁ¿¾Í½«±£³Ö¡£
Ò»¡¢ASP.NET »á»°×´Ì¬¸ÅÊö
¿ÉʹÓà ASP.NET »á»°×´Ì¬´æ´¢ºÍ¼ìË÷Óû§µÄÖµ¡£
µ±Óû§ÔÚ Web Ó¦ÓóÌÐòÖе¼º½ ASP.NET ҳʱ£¬ASP.NET »á»°×´Ì¬Ê¹ÄúÄܹ»´æ´¢ºÍ¼ìË÷Óû§µÄÖµ¡£HTTP ÊÇÒ»ÖÖÎÞ״̬ÐÒé¡£ÕâÒâζ×Å Web ·þÎñÆ÷»á½«Õë¶ÔÒ³ÃæµÄÿ¸ö HTTP ÇëÇó×÷Ϊ¶ÀÁ¢µÄÇëÇó½øÐд¦Àí¡£·þÎñÆ÷²»»á±£ÁôÒÔÇ°µÄÇëÇó¹ý³ÌÖÐËùʹÓõıäÁ¿ÖµµÄÈκÎÐÅÏ¢¡£ASP.NET »á»°×´Ì¬½«À´×ÔÏÞ¶¨Ê±¼ä·¶Î§ÄÚµÄͬһä¯ÀÀÆ÷µÄÇëÇó±êʶΪһ¸ö»á»°£¬²¢ÌṩÓÃÓÚÔڸûỰ³ÖÐøÆÚ¼äÄÚ±£Áô±äÁ¿ÖµµÄ·½·¨¡£Ä¬ÈÏÇé¿öÏ£¬½«ÎªËùÓÐ ASP.NET Ó¦ÓóÌÐòÆôÓà ASP.NET »á»°×´Ì¬¡£
1¡¢»á»°×´Ì¬µÄÌæ´úÏî°üÀ¨£º
Ó¦ÓóÌÐò״̬£¬´æ´¢ ASP.NET Ó¦ÓóÌÐòµÄËùÓÐÓû§¿É·ÃÎʵıäÁ¿¡£
ÅäÖÃÎļþÊôÐÔ£¬½«Óû§Öµ±£ÁôÔÚÊý¾Ý´æ´¢ÇøÖУ¬Ê¹ËüÃDz»»á¹ýÆÚ¡£
ASP.NET »º´æ£¬½«Öµ´æ´¢ÔÚËùÓÐ ASP.NET Ó¦ÓóÌÐò¿ÉÓõÄÄÚ´æÖС£
ÊÓͼ״̬£¬½«Öµ±£ÁôÔÚÒ³ÃæÖС£
Cookie¡£
¿Éͨ¹ý HTML ÇëÇó·ÃÎ浀 HTTP ´°ÌåÉϵIJéѯ×Ö·û´®ºÍ×ֶΡ£
2¡¢»á»°±äÁ¿
ÔÚ ASP.NET Ò³ÖУ¬µ±Ç°»á»°±äÁ¿½«Í¨¹ý Page ¶ÔÏóµÄ Session ÊôÐÔ¹«¿ª¡£
»á»°±äÁ¿¼¯ºÏ°´±äÁ¿Ãû³Æ»òÕûÊýË÷ÒýÀ´½øÐÐË÷Òý¡£¿Éͨ¹ý°´ÕÕÃû³ÆÒýÓûỰ±äÁ¿À´´´½¨»á»°±äÁ¿£¬¶øÎÞÐèÉùÃ÷»á»°±äÁ¿»ò½«»á»°±äÁ¿ÏÔʽÌí¼Óµ½¼¯ºÏÖС£ÏÂÃæµÄʾÀýÑÝʾÈçºÎÔÚ ASP.NET Ò³ÉÏ´´½¨·Ö±ð±íʾÓû§µÄÃû×ÖºÍÐÕÊϵĻỰ±äÁ¿£¬²¢½«ËüÃÇÉèÖÃΪ´Ó TextBox ¿Ø¼þ¼ìË÷µ½µÄÖµ¡£
Session["FirstName"] = FirstNameTextBox.Text;
Session["LastName"] = LastNameTextBox.Text;
»á»°±äÁ¿¿ÉÒÔÊÇÈκÎÓÐЧµÄ .NET Framework ÀàÐÍ¡£ÏÂÃæµÄʾÀý½« ArrayList ¶ÔÏó´æ´¢ÔÚÃûΪ StockPicks µÄ»á»°±äÁ¿ÖС£µ±´Ó SessionStateItemCollection ¼ìË÷ÓÉ StockPicks »á»°±äÁ¿·µ»ØµÄֵʱ£¬±ØÐ뽫´ËֵǿÖÆת»»ÎªÊʵ±µÄÀàÐÍ¡£
// When retrieving an object from session state, cast it to
// the appropriate type.
ArrayList stockPicks = (ArrayList
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÏÂÃæÒÔTest Õ¾µãΪÀý£¬ËµÃ÷Ò»ÏÂÈçºÎÉèÖà .net framework 2.0 aspnet_isapi µÄ IIS ÉèÖÃ
°´Èçϲ½Öè²Ù×÷¼´¿É
1¡¢´ò¿ªÕ¾µã£¬ÓÒ»÷ÊôÐÔ£¬ÕÒµ½Ö÷Ŀ¼£¨±¾Ê¾ÀýÊÇÒÔÐéÄâĿ¼£¬·þÎñÆ÷°æ±¾ÇëÕÒÖ÷Ŀ¼£©
´ò¿ªÈçÏÂͼËùʾµÄ´°¿Ú
......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
»ñÈ¡ÇëÇóµÄÒ³µÄHttpApplicationState ¶ÔÏó¡£
Ò»¡¢HttpApplicationState Àà
×÷ÓãºÆôÓà ASP.NET Ó¦ÓóÌÐòÖжà¸ö»á»°ºÍÇëÇóÖ®¼äµÄÈ«¾ÖÐÅÏ¢¹²Ïí¡£
ASP.NET Ó¦ÓóÌÐòµÄ¸ÅÄÊǵ¥¸ö Web ·þÎñÆ÷ÉϵÄij¸öÐéÄâĿ¼¼°Æä×ÓĿ¼·¶Î§ÄÚµÄËùÓÐÎļþ¡¢Ò³¡ ......
Ò»).´´½¨²¿ÊðÏîÄ¿
1. ÔÚ“Îļþ”²Ëµ¥ÉÏÖ¸Ïò“Ìí¼ÓÏîÄ¿”£¬È»ºóÑ¡Ôñ“н¨ÏîÄ¿”¡£
2. ÔÚ“Ìí¼ÓÐÂÏîÄ¿”¶Ô»°¿òÖУ¬Ñ¡Ôñ“ÏîÄ¿ÀàÐÍ”´°¸ñÖеē°²×°ºÍ²¿ÊðÏîÄ¿”£¬È»ºóÑ¡Ôñ“Ä£°å”´°¸ñÖеē°²×°ÏîÄ¿”¡£ÔÚ“Ãû³Æ”¿ò ......