ѧϰASP.NETÖеÄApplication¡¢Session¡¢Cookie
ѧϰASP.NETÖеÄApplication¡¢Session¡¢Cookie
1.Application½¨Á¢µÄ±äÁ¿£¬ÔÚϵͳÄÚ²¿Èκεط½¶¼¿ÉÒÔ·ÃÎÊ£¬Í¨³£ÍøÕ¾µØ·ÃÎÊͳ¼Æ¿ÉÄÜ»áÓõĽ϶ࡣÈç¹ûÒªÓõ½ApplicationÊ×ÏÈÔÚVS2005Öн¨Á¢Ò»¸öglobal.asaÎļþ¡£ÀýÈçÎÒÃÇҪдһ¸öÍøÕ¾·ÃÎÊÊýÁ¿µÄͳ¼ÆµÄ»°£¬ÔÚglobal.asaÖÐÏÈÉùÃ÷±äÁ¿iCount¡£ÈçÏÂËùʾ£º
protected void Application_Start(object sender, EventArgs e)
{
Application["iCount"] = 0;
}
È»ºóÔÚPage_LoadʼþÖдòÈëÒÔÏ´úÂ룺
protected void Page_Load(object sender, EventArgs e)
{
Application["iCount"] = (int)Application["iCount"] + 1;
Response.Write(Application["iCount"]);
}
ÔËÐкó¾Í¿ÉÒÔ¿´µ½¼ÆÊý£¬Ã¿Ë¢ÐÂÒ»´Î¼ÆÊý»á×Ô¶¯ÀÛ¼Ó¡£Èç¹ûҪֹͣÀۼӵĻ°£¬Ö»ÄÜ°ÑIISÍ£Ö¹ºóÔÙÆô¶¯£¬´Ëʱ¼ÆÊý»á×Ô¶¯¹éÁã
ÓÉÓÚApplication±äÁ¿ÊÇÒ»¸ö¹²ÏíµÄ¶ÔÏó£¬ËùÒÔÓжàÈËÀ´·ÃÎÊËüµÄʱºòÎÒÃǾͱØÐëÓõ½Ëø¶¨¡£µ±Ä³Ò»¸öÓû§ÐèÒª²Ù×÷ËüµÄʱºò¾ÍÓÃlockËø¶¨Ëü£¬²Ù×÷Íê³ÉºóÓÃunlockÀ´½âËø¡£´úÂëÈçÏ£º
protected void Page_Load(object sender, EventArgs e)
{
Application.Lock;
Application["iCount"] = (int)Application["iCount"] + 1;
Application.UnLock;
Response.Write(Application["iCount"]);
}
2. SessionÊÇÿ¸öÓû§Ê¹ÓóÌÐòʱ¾Í»á½¨Á¢¶ÔÏó£¬Ò²¾ÍÊÇApplication¶ÔÏóÖ»ÓÐÒ»¸ö£¬¶øSession¶ÔÏóÓкܶà¸ö¡£Session²
Ïà¹ØÎĵµ£º
½ñÔçÓиöÍøÓÑÎʵ½ÎÒÕâÎÊÌ⣬ÒÔÇ°ÎÒ¶¼ÊÇÖ±½ÓÔÚÊý¾Ý¿âÖдæÎļþÃûµÄ£¬»¹Ã»ÓÐÊÔ¹ý´æ´¢ÕûÕÅͼƬµ½Êý¾Ý¿âÖУ¬ÉÏÍøËÑË÷ÁËһϣ¬×Ô¼ºÓÖ²âÊÔÁËÒ»·¬£¬´úÂëÈçÏ£º
½¨Á¢±£´æͼƬµÄ±íµÄSQLÓï¾ä£º
Sql´úÂë < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://w ......
»ùÓÚ¹¦Äܸü·á¸»µÄ»ù´¡À๹½¨Äú×Ô¼ºµÄ ASP.NET Ò³Ãæ
·¢²¼ÈÕÆÚ : 11/4/2004 | ¸üÐÂÈÕÆÚ : 11/4/2004
Dino Esposito
Wintellect
ÊÊÓ÷¶Î§£º
Microsoft ASP.NET
Microsoft ASP.NET 2.0
ÕªÒª£ºÍ¨¹ý¼Ì³Ð¿ÉÒÔÔÚͨÓà Microsoft ASP.NET ÀࣨÀýÈç Page ÀࣩÖÐÌí¼Ó¹¦ÄÜ¡£ÕâΪÄúÌṩÁËÒ»¸ö¹«¹²³¡Ëù£¬Ê¹Äú¿ÉÒÔÌí¼Ó¹¦Äܲ¢½«¹¦Äܲ¿ ......
Ê×Ïȼòµ¥½éÉÜһϠWCF ÊÇʲô£¬È»ºóÔÙ¶Ô WCF ºÍ Asp.net Web service ×ö¸ö±È½Ï¡£
Windows Communication Foundation (WCF) ÊÇÓÃÓÚ¹¹½¨ÃæÏò·þÎñµÄÓ¦ÓóÌÐòµÄ¿ò¼Ü¡£½èÖú WCF£¬¿ÉÒÔ½«Êý¾Ý×÷ΪÒì²½ÏûÏ¢´ÓÒ»¸ö·þÎñÖÕ½áµã·¢ËÍÖÁÁíÒ»¸ö·þÎñÖÕ½áµã¡£·þÎñÖÕ½áµã¿ÉÒÔÊÇÓÉ IIS ³ÐÔصijÖÐø¿ÉÓõķþÎñµÄÒ»²¿·Ö£¬Ò²¿É ......
1.Asp.NetÖм¸ÖÖÏàËƵıê¼Ç·ûºÅ: < %=...%>< %#... %>< % %>< %@ %>½âÊͼ°Ó÷¨
´ð: < %#... %>: ÊÇÔڰ󶨿ؼþDataBind()·½·¨Ö´ÐÐʱ±»Ö´ÐУ¬ÓÃÓÚÊý¾Ý°ó¶¨
Èç: < %# Container.DataItem("tit") %>
< %= %>: ÔÚ³ÌÐòÖ´ÐÐʱ±»µ÷Ó㬿ÉÒÔÏÔʾºǫ́±äÁ¿Öµ
Èç:
*.aspxÖУº < %= a ......
Ò»¡¢Ê¹ÓÃQueryString²ÎÊý
QueryString½«´«µÝµÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖУ¬ÊÇÒ»Öַdz£¼òµ¥Ò²Ê¹ÓñȽ϶àµÄ´«Öµ·½Ê½¡£
Èç¹û´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨
/// <summary>
/// ʹÓÃQueryString±äÁ¿
/// </summary>
/// <param name="param1"></param>
/// ......