Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

CookieÓ¦ÓÃÍêÈ«½âÎö£¨Ò»£©£ºasp.netÖÐCookie¼¼Êõ

Cookie ÊÇʲô£¿
 
ÔÚasp.netÖУ¬ÈçºÎʹÓã¿
 
 
 
1   Cookie ÊÇʲô£¿
 
Cookie£ºµçÄÔÖмǼÓû§ÔÚÍøÂçÖеÄÐÐΪµÄÎļþ£»ÍøÕ¾¿Éͨ¹ýCookieÀ´Ê¶±ðÓû§ÊÇ·ñÔø¾­·ÃÎʹý¸ÃÍøÕ¾¡££¨Õª×Ô http://gb.cri.cn/17004/2007/03/08/121@1487554.htm£©
2ÔÚasp.netÖУ¬ÈçºÎʹÓã¿
 
 
ASP.NETͨ¹ýSystem.Web¿Õ¼äÃû³ÆÒ²ÌṩÁËcookieµÄ·ÃÎÊ¡£ËäÈ»Äã²»Ó¦¸ÃʹÓÃcookieÀ´´æ´¢Ò»Ð©Ãô¸ÐÐÔµÄÊý¾Ý£¬µ«ÊÇ£¬ËüÃÇÊÇ´¦ÀíËøϸÊý¾ÝµÄÒ»¸ö¼«ºÃµÄÑ¡Ôñ£¬±ÈÈçÑÕÉ«²ÎÊýÑ¡Ôñ»òÕß×îºóÒ»´Î·ÃÎÊÈÕÆÚ¡£
´«µÝcookies
cookieÊÇ´æ´¢ÔÚ¿Í»§¶Ë¼ÆËã»úµÄÒ»¸öСÎļþ¡£Èç¹ûÄãÊÇÒ»¸öWindowsÓû§£¬¿ÉÒÔÔÚÓû§Â·¾¶Öв鿴Cookies·¾¶£¬¼´ÎªDocuments And Settings·¾¶¡£Õâһ·¾¶°üº¬ÕâÒ»ÎļþÃû³ÆµÄÎı¾Îļþ£º
username @ Web site domain that created the cookie
(Óû§Ãû³Æ@½¨Á¢cookieµÄÕ¾µãÓòÃû)
.NET System.Web¿Õ¼äÃû³Æ°üº¬Èý¸öÀ࣬Äã¿ÉÒÔʹÓÃËüÃÇÀ´´¦Àí¿Í»§¶ËµÄCookies£º
HttpCookie£ºÌṩһ¸ö½¨Á¢ºÍ²Ù×÷¶ÀÁ¢HTTP cookiesµÄ°²È«ÀàÐ͵ķ½Ê½¡£
HttpResponse£ºCookiesÊôÐÔÔÊÐí²Ù×÷¿Í»§¶Ëcookies¡£
HttpRequest£ºCookiesÊôÐÔÔÊÐí·ÃÎÊ¿Í»§¶Ë²Ù×÷µÄcookies¡£
HttpResponseºÍHttpRequest¶ÔÏóµÄCookiesÊôÐÔ½«·µ»ØÒ»¸öHttpCookieCollection¶ÔÏó£¬Ëü°üº¬×Å£¬½«µ¥¶ÀµÄcookiesÌí¼Óµ½¼¯ºÏ(collection)ÖУ¬ÒÔ¼°´Ó¼¯ºÏ(collection)»ñµÃÒ»¸öµ¥¶ÀµÄcookies¡£
HttpCookieÀà
HttpCookieÀàÕë¶ÔÓÚ¿Í»§´æ´¢Ö®Óöø½¨Á¢µÄµ¥¶Àcookies¡£Ò»µ©HttpCookie¶ÔÏó±»½¨Á¢£¬Äã¿ÉÒÔ½«ÆäÌí¼Óµ½HttpResponse¶ÔÏóµÄCookiesÊôÐÔÖС£Í¬ÑùµÄ£¬Äã¿ÉÒÔͨ¹ýHttpRequest¶ÔÏó·ÃÎÊÏÖÓеÄcookies¡£HttpCookieÀà°üº¬ÒÔÏµĹ«ÓÐÊôÐÔ£º
Domain(ÓòÃû)£º»ñµÃ»òÉèÖÃÓëcookieÓйصÄÓòÃû£¬¿ÉÓÃÓÚÏÞÖÆÌض¨ÇøÓòµÄcookie·ÃÎÊ¡£
Expires(ÆÚÏÞ)£º»ñµÃ»òÉèÖÃcookieµÄÖÕÖ¹ÈÕÆÚºÍʱ¼ä£¬Äã¿ÉÒÔ½«ÆäÉèÖÃΪһ¸ö¹ýÈ¥µÄÈÕÆÚÒÔ×Ô¶¯ÖÕÖ¹»òÕßɾ³ýcookie¡£
Names(Ãû³Æ)£º»ñµÃ»òÉèÖÃcookieÃû³Æ¡£
Path(·¾¶)£º»ñµÃ»òÉèÖÃcookieµÄÐéÄâ·¾¶¡£ÕâÒ»ÊôÐÔÔÊÐíÄãÏÞÖÆcookie·¶Î§£¬Ò²¾ÍÊÇ˵£¬·ÃÎÊcookieÖ»ÄÜÏÞÖÆÓÚÒ»¸öÌض¨µÄÎļþ¼Ð»òÕß·¾¶¡£ÉèÖÃÕâÒ»ÊôÐÔÏÞÖÆΪֻÄÜ·ÃÎÊÌض¨Â·¾¶ºÍ¸Ã·¾¶ÏµÄËùÓÐÎļþ¡£
Secure(°²È«)£º·¢ÐźÅÒÔ±íʾÊÇ·ñʹÓÃSecure Sockets Layer (SSL)À´·¢ËÍcookieÖµ¡£
Value(Öµ)£º»ñµÃ»òÉèÖÃÒ»¸öµ¥¶ÀµÄcookieÖµ¡£
Values(ÐÅÏ¢)£º·µ»Ø°üº¬ÔÚcookieÖеÄkey/valueµÄÒ»¸ö¼¯ºÏ¡£
ʹÓÃÑùÀý£º
 


Ïà¹ØÎĵµ£º

asp.netÖÐÈçºÎ±éÀúHashTable

asp.net±éÀúHashTableÐèÒªÓõ½DictionaryEntry Object£¬asp.net±éÀúHashTable£¬¿ÉÒÔͨ¹ýÈçÏÂÁ½ÖÖ·½·¨À´ÊµÏÖ£¬
·½·¨Ò»£º
foreach (System.Collections.DictionaryEntry objDE in objHasTab)
{
    Console.WriteLine(objDE.Key.ToString());
    Console.WriteLine(objDE.Value.ToString ......

ASP.NET´¦Àí³ÌÐòºÍÄ£¿é£¨Ò»£©

ASP.NET´¦Àí³ÌÐòºÍÄ£¿é
          
          ASP.NET HTTP ´¦Àí³ÌÐò(Handler)ÊÇÏìÓ¦¶Ô ASP.NET Web Ó¦ÓóÌÐòµÄÇëÇó¶øÔËÐеijÌÐò
          
          Èç´¦Àí *.aspxÎļþµÄASP.NET´¦Àí³ÌÐò ......

ASP.NETÍøÕ¾¿ª·¢Ð¡½á

1.<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
Vs2005ºìÉ«ÁË£¬ÌáʾÕÒ²»µ½¸ÃÎļþ
ÓÚÊǸÄΪ.<script src="/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
½á¹ûºìɫûÓÐÁË£¬µ«ÊDZàÒëʱ±¨´í£¬ÕÒ²»µ½¸ÃÎļþ
½áÂÛ£º<script src="Script ......

asp.net»ñÈ¡´«ÖµgetºÍpostÇëÇó

//postÇëÇó
string name = Request["name"].toString();
string name =Request.Form.Get("name").toString();
//getÇëÇó
string name = Request.QueryString["name"].toString();
µ«ÎÒ·¢ÏÖ ÎÞÂÛÊÇ·ñÊÇpostÓëget´«Öµ¶¼¿ÉÓÃ
string name = Request["name"].toString();

±íµ¥Ìá½»ÖÐgetºÍpost·½Ê½µÄÇø±ð¹éÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ