ASP.NET ״̬·þÎñ ¼° session¶ªÊ§ÎÊÌâ½â¾ö·½°¸×ܽá
asp.net SessionµÄʵÏÖ£º
asp.netµÄSessionÊÇ»ùÓÚHttpModule¼¼Êõ×öµÄ£¬HttpModule¿ÉÒÔÔÚÇëÇó±»´¦Àí֮ǰ£¬¶ÔÇëÇó½øÐÐ״̬¿ØÖÆ£¬ÓÉÓÚSession±¾Éí¾ÍÊÇÓÃÀ´×ö״̬ά»¤µÄ£¬Òò´ËÓÃHttpModule×öSessionÊÇÔÙºÏÊʲ»¹ýÁË¡£
ASP.NETÖÐSessionµÄ״̬±£³Ö·½Ê½
ASP.NETÌṩÁËSession¶ÔÏ󣬴ӶøÔÊÐí³ÌÐòԱʶ±ð¡¢´æ´¢ºÍ´¦Àíͬһ¸öä¯ÀÀÆ÷¶ÔÏó¶Ô·þÎñÆ÷ÉÏij¸öÌض¨ÍøÂçÓ¦ÓóÌÐòµÄÈô¸É´ÎÇëÇóµÄÉÏÏÂÎÄÐÅÏ¢¡£Session¶ÔÓ¦ä¯ÀÀÆ÷Óë·þÎñÆ÷µÄͬһ´Î¶Ô»°£¬ÔÚä¯ÀÀÆ÷µÚÒ»ÇëÇóÍøÂçÓ¦ÓóÌÐòµÄij¸öÒ³Ãæʱ£¬·þÎñÆ÷»á´¥·¢Session_onStartʼþ£»ÔÚ¶Ô»°³¬Ê±»òÕß±»¹Ø±ÕµÄʱºò»á´¥·¢Session_onEnd ʼþ¡£³ÌÐòÔ±¿ÉÒÔÔÚ´úÂëÖÐÏìÓ¦ÕâÁ½¸öʼþÀ´´¦ÀíÓëͬһ´Î¶Ô»°Ïà¹ØµÄÈÎÎñ£¬È翪±ÙºÍÊͷŸôζԻ°ÒªÊ¹ÓõÄ×ÊÔ´µÈ¡£
ÔÚASP.NETµÄ³ÌÐòÖÐҪʹÓÃSession¶ÔÏóʱ£¬±ØÐëÈ·±£Ò³ÃæµÄ@pageÖ¸ÁîÖÐEnableSessionStateÊôÐÔÊÇTrue»òÕßReadonly£¬²¢ÇÒÔÚweb.configÎļþÖÐÕýÈ·µÄÉèÖÃÁËSessionStateÊôÐÔ¡£
ASP.NETÖÐSessionµÄ״̬±£³ÖÊÇÓÉweb.configÎļþÖеÄ<system.web>±ê¼ÇϵÄ<sessionstate>±ê¼ÇµÄmodeÊôÐÔÀ´¾ö¶¨µÄ¡£¸ÃÊôÐÔÓÐËÄÖÖ¿ÉÄܵÄÖµ£ºOff¡¢Inproc¡¢StateServerºÍSQlServer.
ÉèΪOff»á½ûÓÃSession.
InprocÊÇȱʡµÄÉèÖÃ,ÕâÖÖģʽºÍÒÔÇ°µÄASPµÄ»á»°×´Ì¬µÄ·½·¨ÊÇÀàËƵÄ,»á»°µÄ״̬»á±»±£´æÔÚASP.NET½ø³ÌÖУ¬ËüµÄÓŵãÊÇÏÔ¶øÒ×¼ûµÄ£ºÐÔÄÜ¡£½ø³ÌÄÚµÄÊý¾Ý·ÃÎÊ×ÔÈ»»á±È¿ä½ø³ÌµÄ·ÃÎʿ졣Ȼ¶ø£¬ÕâÖÖ·½·¨SessionµÄ״̬ÒÀÀµÓÚASP.NET½ø³Ì£¬µ±IIS½ø³Ì±ÀÀ£»òÕßÕý³£ÖØÆðÆôʱ£¬±£´æÔÚ½ø³ÌÖеÄ״̬½«¶ªÊ§¡£
ΪÁË¿Ë·þInprocģʽµÄȱµã£¬ASP.NETÌṩÁËÁ½ÖÖ½ø³ÌÍâ±£³Ö»á»°×´Ì¬µÄ·½·¨¡£
ASP.NETÊ×ÏÈÌṩÁËÌṩÁËÒ»¸öWindows·þÎñ£ºASPState,Õâ¸ö·þÎñÆô¶¯ºó£¬ASP.NETÓ¦ÓóÌÐò¿ÉÒÔ½«modeÊôÐÔÉèÖÃΪ“SateServer”,À´Ê¹ÓÃÕâ¸öWindows·þÎñÌṩµÄ״̬¹ÜÀí·½·¨¡£
³ýÁËÔÚweb.configÎļþÖÐÉèÖÃmodeÊôÐÔΪStateServerÍ⣬»¹±ØÐëÉèÖÃÔËÐÐStateServer·þÎñÆ÷µÄIPµØÖ·ºÍ¶Ë¿ÚºÅ.Èç¹ûÔÚIISËùÔڵĻúÆ÷ÔËÐÐStateServerÔòIPµØÖ·¾ÍÊÇ127.0.0.1,¶Ë¿ÚºÅͨ³£ÊÇ42424.ÅäÖÃÈçÏ£º
mode=”StateServer”
stateConnectionString="tcpip=127.0.0.1:42424"
ʹÓÃÕâÖÖģʽ,»á»°×´Ì¬µÄ´æ´¢½«²»ÒÀÀµIIS½ø³ÌµÄʧ°Ü»òÕßÖØÆô,»á»°µÄ״̬½«´æ´¢ÔÚStateServer½ø³ÌµÄÄÚ´æ¿Õ¼äÖС£
ÁíÒ»ÖֻỰ״̬ģʽÊÇSQLServerģʽ¡£ÕâÖÖģʽÊǽ«»á»°µÄ״̬±£´æÔÚSQL ServerÊý¾Ý¿âÖÐ
Ïà¹ØÎĵµ£º
ÎÒÓÃC# дµÄÒ»¸öWindowsÓ¦ÓóÌÐòÀï,ÓÃTeeChartʵÏÖÁËÒ»¸öÕÛÏßͼ.
XÖáÊÇʱ¼ä,YÖáÊÇÊýÖµ,¼ÓÁ˸öÒ»´¹Ö±µÄCursorTool.
Êó±êÔÚͼÉÏÒƶ¯Ê±,´¹Ö±µÄCursorTool»á¸ú×ÅÊó±êÅÜ,²¢´¥·¢CursorToolµÄChangeʼþ.
ÔÚCursorToolµÄChangeʼþÀï,
ÎÒÈ¡³öÁËÇúÏßÓë´¹Ö±µÄÏß½»µã´¦µÄ,ʱ¼äÖµ,ºÍÊýÖµ.
ÎÒдÕâ¸öWindow³ÌÐòµÄÖ÷ÒªÉϵÄÊÇÃþ ......
string destFileName = "ok.txt";
destFileName = Server.MapPath(".") + "\\"+destFileName;
destFileName = Server.UrlDecode(destFileName);
&nbs ......
×÷Õߣºº®Óð·ã(cityhunter172)
Ðò
´úÂëд N ¾ÃÁË£¬×ÜÏëдµÃ±ðµÄ¡£Õâ²»£¬ÉÏͷ˵ÔÚÕûºÏÁ½¸öÏîÄ¿£¬×ö³Éµ¥Ò»µÇ¼£¨Single Sign On£©£¬Ò²ÓÐÈ˳Æ֮Ϊ“µ¥µãµÇ¼”¡£²éÔÄÏà¹ØÎĵµºó£¬ÖÕÓÚʵÏÖÁË£¬ÏÖÔÚ°ÑËüÄóöÀ´Óë´ó¼ÒÒ»Æð·ÖÏí¡£»òÐí´ó¼Ò»áÎÊ£º“ÕâÓë±êÌâ²»·ûѽ£¿”±ð¼±£¬ÔÚϱÊ֮ǰ£¬ÎÒÄÔ×ÓÀïÏëµ½ÁËÎÒ¸ÕʹÓà ......
——ÇÉÃîʵÏÖ Form ±íµ¥ÈÏÖ¤¿çÕ¾µã¡¢¿ç·þÎñÆ÷µÄµ¥µãµÇ¼£¨Single Sign On£©
×÷Õߣºº®Óð·ã(cityhunter172)
µÚËIJ¿·Ö Form ÈÏÖ¤µÄ²¹³ä
Ç°ÈýƪÔÚ CSDN ÂÛ̳¹«²¼ºó£¬Ð§¹ûÈçͬ“ÉñÏÉ·Åƨ——¹ûÈ»²»Í¬·²£¨·´£©Ï씡£Îª¸Ðл¹ã´óÍøÓѵÄÈÈÇéÓëÖ§³Ö£¬Õâ²»£¬¾¹ýÕâÒ»Õó×ÓµÄÔÍÄð¡¢ÐÞÁ¶£¬ÌØÒâ×¼±¸ÁËÕâµ ......
Õâ¸öÊÇÔÚÍøÉÏÕÒµÄÒ»¸ö¹ØÓÚASP.NET MVC µÄ¶¨Ò壬ÎÒ¾õµÃÒѾ½âÊ͵Ĺ»ºÃÁË£¬ËùÒԾͽè¹ýÀ´ÓÃÓÃÁË £¬ºÇºÇ
Ï£ÍûÓÐÐÄѧϰASP.NET MVC µÄÅóÓÑÏÈÊìϤ¶¨Ò壬ÔÚºóÐøµÄÎÄÕÂÖлá¸üÇáËɵÄѧϰASP.NET MVC
ÏÂÃæÎÒÃÇÒ»Æð̤ÉÏASP.NET MVC Ö®Âðɣ¬Ö»ÒªÓкãÐĺÍÒãÁ¦£¬×£Ñ§ÕßÃÇÂÃ;Óä¿ì£¡
The Model-View-Controller (MVC) architectu ......