ASP.NETʹÓÃÎÞCookieµÄ±íµ¥ÈÏ֤Ʊ¾Ý
ASP.NET
ʹÓÃÎÞCookieµÄ±íµ¥ÈÏ֤Ʊ¾Ý
ĬÈÏÇé¿öÏ£¬forms authentication system½«¾ö¶¨Êǽ«Æ±¾Ý´æ´¢ÔÚcookies
collectionÀﻹÊDzåÈëÓû§·ÃÎÊÒ³ÃæµÄURLÀï¡£ËùÓÐÖ÷Á÷µÄ×ÀÃæä¯ÀÀÆ÷£¬±ÈÈçInternet
Explorer£¬Firefox£¬Opera£¬»òSafari¶¼Ö§³Öcookies£¬µ«²¢·ÇËùÓеÄÒƶ¯É豸¶¼Ö§³Ö¡£
forms authentication systemʹÓúÎÖÖcookie²ßÂÔ£¬È¡¾öÓÚ
ÔªËØÀïµÄcookielessÉèÖã¬Ëü¿ÉÒÔÓÐÈçÏÂËÄÖÖÅäÖãº
.UseCookies——Ö¸¶¨×ÜÊÇʹÓûùÓÚcookieµÄƱ¾Ý
.UseUri——Ö¸¶¨´Ó²»Ê¹ÓûùÓÚcookieµÄƱ¾Ý
.AutoDetect——Èç¹ûdevice
profile²»Ö§³Öcookies£¬¾Í²»Ê¹ÓûùÓÚcookieµÄƱ¾Ý£»Èç¹ûdevice
profileÖ§³Öcookies£¬ÄÇô¾ÍÔËÓÃÒ»ÖÖ̽²â»úÖÆÀ´ÅжÏÊÇ·ñ¿ÉÒÔʹÓÃcookies.
.UseDeviceProfile——ÕâÊÇĬÈÏÖµ£¬Èç¹ûdevice
profileÖ§³Öcookies£¬¾ÍʹÓûùÓÚcookieµÄƱ¾Ý£¬²»ÔËÓÃ̽²â»úÖÆ¡£
ÆäÖУ¬AutoDetect ºÍ
UseDeviceProfileÑ¡ÏÒÀ¿¿Ò»¸ödevice
profileÀ´ÅжÏÊÇʹÓûùÓÚcookie»¹ÊÇÎÞcookieµÄƱ¾Ý¡£ASP.NETÓÐÒ»¸ö¹ØÓÚÕâÖÖdevices¼°ÆäÐÔÄܵÄÊý¾Ý¿â£¬±ÈÈçijÖÖ
devicesÊÇ·ñÖ§³Öcookies£¬ËüÖ§³ÖÄǸö°æ±¾µÄJavaScriptµÈÐÅÏ¢¡£Ã¿´Î£¬µ±Ò»¸ödeviceÏò·þÎñÆ÷·¢³ö¶Ôij¸öÒ³ÃæµÄÇëÇóʱ£¬¸ÃÇëÇó
Àォ°üº¬Ò»
¸öÃûΪ“user-agent”µÄHTTP
header£¬ÓÃÓÚ±íÃ÷deviceµÄÀàÐÍ¡£ASP.NET
½«×Ô¶¯µÄ°ÑÌṩµÄuser-agent×Ö·û´®ÓëÊý¾Ý¿âÀïÏàÓ¦µÄÐÅϢƥÅäÆðÀ´¡£
×¢Ò⣺
¸ÃÊý¾Ý¿â
´æ´¢ÔںܶàµÄXMLÎļþÀï.ÕâЩĬÈϵÄdevice
profileÎļþ£¬Æä·¾¶Îª%WINDIR%\Microsoft.Net\Framework\v2.0.50727\CONFIG
\Browsers¡£ÄãÒ²¿ÉÒÔÔÚÄãÓ¦ÓóÌÐòµÄApp_BrowsersÎļþ¼ÐÀïÌí¼Ó×Ô¶¨ÒåµÄÎļþ£¬¹ØÓÚÕâ·½ÃæµÄ¸ü¶àÐÅÏ¢£¬Çë²ÎÔÄÎÄÕ¡¶How To:
Detect Browser Types in ASP.NET Web Pages¡·
ÓÉÓÚĬÈÏʹÓõÄÊÇUseDeviceProfileÑ¡Ïî.µ±·ÃÎÊÕ¾µãµÄij¸ödevice²»Ö§
³Öcookiesʱ£¬¾ÍÕ¾µã¾ÍʹÓÃÎÞcookieµÄƱ¾Ý.
ÔÚURLÀï¶ÔƱ¾Ý½øÐбàÂë
µ±ä¯ÀÀÆ÷ÿ´ÎÏòij¸öÕ¾µã·¢³öÇëÇóʱ£¬ÓÃÀ´´æ´¢ÐÅÏ¢µÄÔØÌåͨ³£ÊÇCookies¡£µ«Èç¹û·ÃÎÊÕ¾
µãµÄdevice²»Ö§³ÖCookiesµÄ»°£¬ÎÒÃDZØÐëʹÓÃijÖÖ·½·¨ÔÚ¿Í»§¶ËºÍ·þÎñÆ÷¶Ë´«µÝƱ¾Ý£¬Í¨³£µÄ×ö·¨ÊÇÔÚURLÀォcookieÊý¾Ý±àÂë¡£
ΪÁ˽øÐÐÑÝʾ£¬ÎÒÃǽ«Ç¿ÆÈÕ¾µãʹÓÃÎÞcookieµÄƱ¾Ý£¬Îª´ËÎÒÃǽ«²ÉÓÃUseUri:
×öÁËÉÏÊöÐ޸ĺó£¬Í¨¹ýä¯ÀÀÆ÷·ÃÎÊ.µ±ÒÔÄäÃûÓû§½øÐзÃÎÊʱ£¬URL¿´ÆðÀ´ºÍÒÔǰûʲôÇø±ð£¬
Ïà¹ØÎĵµ£º
ÈÏʶASP.NETÅäÖÃÎļþWeb.config
¡¡¡¡Ò»¡¢ÈÏʶWeb.configÎļþ
¡¡¡¡Web.configÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢(Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½)£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ýVB.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈ쵀 ......
HttpHandlerʵÏÖÁËÀàËÆÓÚISAPI ExtentionµÄ¹¦ÄÜ£¬Ëû´¦ÀíÇëÇó(Request)µÄÐÅÏ¢ºÍ·¢ËÍÏìÓ¦(Response)¡£HttpHandler¹¦ÄܵÄʵÏÖͨ¹ýʵÏÖIHttpHandler½Ó¿ÚÀ´´ïµ½¡£¶øHttpModuleʵÏÖÁËÀàËÆÓÚISAPI FilterµÄ¹¦ÄÜ¡£
HttpModuleµÄʵÏÖ
HttpModulesʵÏÖÁËÀàËÆÓÚISAPI FilterµÄ¹¦ÄÜ£¬ÔÚ¿ª·¢ÉÏ£¬Í¨³£ÐèÒª¾¹ýÒÔϲ½Ö裺
±àдһ¸öÀà£¬Ê ......
ÎҵĻú×ÓÔ±¾¾ÍÓÐInternetÐÅÏ¢·þÎñ£¨IIS£©µÄ°²×°Ñ¡ÏÏÂÁ˺ܶà°æ±¾µÄIIS»òi386Îļþ¿É¾ÍÊÇȱÕâȱÄǵģ¬Èç:iisapp.vbs
°´ÍøÉÏ˵µÄÐÞ¸´Êý¾ÝÒ²ºÁÎÞÆðÉ«£¬×îºó
½â¾ö·½°¸£º
Ê×ÏÈÔÚ“¿ªÊ¼”²Ëµ¥µÄ“ÔËÐДÖÐÊäÈë“c:\Windows\inf\sysoc.inf”£¬ÏµÍ³»á×Ô¶¯Ê¹ÓüÇʱ¾´ò¿ªsy ......
1¡¢½¨Á¢Êý¾Ý²ã Á¬½ÓÊý¾Ý¿â->½¨Á¢Êý¾Ý¼¯*.xsd->±íÖн¨Á¢²éѯ·½·¨
2¡¢½¨Á¢ÒµÎñÂß¼²ã °ü×°TableAdapter·½·¨³ÉÀà
3¡¢½¨Á¢Ä¸°åÒ³ºÍÕ¾µãµ¼º½£¨ CSS´ýѧϰ£©
4¡¢Ê¹ÓÃÊý¾ÝÔ´Õ¹ÏÖÊý¾Ý ÎåÖÖÊý¾ÝÔ´ ±à¼Êý¾ÝÔ´²ÎÊý ʹÓÃtableadapter·½·¨
5¡¢Ê¹ÓÃdropDownList¹ýÂËÖ÷-´Ó±¨±í
ʹÓÃtableadapter·½·¨ ......
Ϊÿ¸öÓû§´æ´¢ÅäÖÃÐÅÏ¢ ÒÔÇ°±£´æÓû§ÅäÖÃÐÅϢʱÓõ½µÄÊÇsessionºÍcookie¡£ session»á»°½áÊø£¬±£´æµÄ¸öÈËÐÅÏ¢¾Í»á¶ªÊ§£¬¶øcookieÔÚÒ»¶¨³Ì¶ÈÉÏ´æÔÚ°²È«Òþ»¼
asp.net 2.0ÒýÈëµÄprofile¼¼Êõ ¿ÉÒԺܺõĽâ¾ö¸ÃÎÊÌâ¡£
Ç¿ÀàÐÍ ³¤ÆÚ±£´æ Ö§³ÖÄäÃûÓû§
¶¨ÒåÅäÖã¨profile£©
<?xml version="1.0"?>
<c ......