asp.net(c#)»º´æCache¶ÔÏó£¨Ñ§Ï°ÈÕ¼ÇÒ»£©
ʲôÊÇCache¶ÔÏó?
ÄãÔÚÉú³É¸ßÐÔÄÜÍøÂçÓ¦ÓóÌÐòʱËùÓöµ½µÄÒ»¸öÎÊÌâ¾ÍÊÇÐèÒª±ÜÃâÖظ´¡£Ò»¸öCache¶ÔÏóÔÊÐíÔÚËüÃǵÚÒ»´Î±»ÇëÇóʱÔÚÄÚ´æÖлº´æÏȻºó½«±»»º´æµÄ¸±±¾ÓÃÓÚÒÔºóµÄÇëÇó¡£Ê¹Óñ»»º´æµÄ¸±±¾ÔÊÐíÄã±ÜÃâÖؽ¨Âú×ãÒÔÇ°ÇëÇóµÄÐÅÏ¢£¬ÌرðÊÇÄÇЩÿ´Î´´½¨Ê±¶¼ÐèÕ¼ÓÐÃ÷ʾµÄ·þÎñÆ÷ÉϵĴ¦ÀíÆ÷ʱ¼äµÄÃüÁî¡£
³ý»º´æ¸ö±ðÏÈ绺´æÖеļÆËã½á¹ûÒÔÍ⣬Asp.netÌṩһ¸öÊä³ö»º´æ¿ÉÓÃÓÚ±£´æÍøÒ³ºÍÓû§¿Ø¼þ¡£Cache¶ÔÏóºÍÊä³ö»º´æÊÇÓµÓÐÏàͬµÄ½ÇÉ«ºÍÊôÐÔ£¬µ«ËüÃÇÊǽÔÈ»²»Í¬µÄÁ½ÖÖ¶ÔÏó¡£
ASP.NETÌṩһ¸öÈ«ÌØÐԵĻº´æÒýÇ棬ÓÃÓÚ±£´æºÍ»ñÈ¡ÐÅϢƬ¶Î¡£Cache¶ÔÏóûÓйØÓÚËüËù°üº¬µÄµÄÏîµÄÐÅÏ¢¡£Cache¶ÔÏó½ö°üº¬¶ÔÓÚÄÇЩ¶ÔÏóµÄÒýÓÃÒÔ¼°ÌṩËüÃǵÄÒÀÀµÏîºÍÉèÖùýÆÚ²ßÂÔ¡£Cache»¹Ìṩ·½·¨ÔÚÏàͬÍøÂçÓ¦ÓóÌÐòµÄÍøÒ³Ö®¼ä´«µÝÖµ¡£»º´æ·½·¨ÊµÏÖ×Ô¶¯µÄËø£¬ËùÒÔ£¬ÖµÔÚ±»¶à¸öÒ³²¢·¢·ÃÎÊʱÊÇ°²È«µÄ¡£
ÄÇôCache¶ÔÏóÊÇÈçºÎ¹¤×÷µÄÄÄ£¿
ʹÓÃCache¶ÔÏóµÄµÄ¹ý³ÌÊÇ£º
¡¡¡¡1. Ò³ÃæÇëÇóµÄÏî±»±êʶΪÒѾÔÚCache¶ÔÏóÖб£´æ¡£
¡¡¡¡2. ASP.NET ¼ì²é Cache ¶ÔÏó²¢ÓÃÒÑ»º´æµÄ°æ±¾À´¾ö¶¨ÊÇ·ñ¿ÉÓá£
¡¡¡¡3. Èç¹û»º´æµÄ°æ±¾²»¿ÉÓã¬ASP.NET ÖØд´½¨ÏʹÓôËÏȻºó½«Ëü±£´æÔÚCache¶ÔÏóÒÔ±¸ºóÓá£
ÎÒÃÇÈçºÎʹÓÃCache¶ÔÏóµÄ¼üÖµ¶Ô£¿
Cache¶ÔÏóʹÓüüÖµ¶Ô±£´æºÍ»ñÈ¡¶ÔÏó¡£¼üÊÇ»º´æ¼ü×Ö·û´®£¬ÓÃÓÚÒýÓöÔÏó¡£ÖµÊDZ»»º´æµÄ¶ÔÏó¡£ÔÚ×î¼òµ¥µÄÀý×ÓÖУ¬½«Ïî·Åµ½»º´æÖÐÔÙ»ñÈ¡Ëü¾ÍÏñÊǽ«Ä³Ïî±»·Åµ½×ÖµäÖС£
ÒªÏ뽫ÏîÌí¼Óµ½Cache¶ÔÏó£º Cache["mykey"] = myValue;
ÒªÏë´ÓCache¶ÔÏóÖлñÈ¡Ï myValue = Cache["mykey"];
´úÂëʾÀýÈçÏ£º
DataTable dt = new DataTable();
…………………………………………
Cache["ObjDataTable"] = dt; ½«Ò»¸öDataTable»º´æµ½Cache¶ÔÏóÖС£
DataTable dt = new DataTable();
dt = Cache["ObjDataTable"] as DataTable; ½«±»±£´æÔÚ»º´æÖÐDataTable´Ó»º´æÖлñÈ¡¡£
ת×Ô ÍøÂç×ÔÓÉÈË
Ïà¹ØÎĵµ£º
AutoPostBackÄÄÈ¥ÁË?
´ÓǰʹÓÃweb
Form¿ª·¢µÄ³ÌÐòÔ±¾³£»áÎʵ½AutoPostBackÅÜÄÄÈ¥ÁË£¿Ê¹ÓÃIDE£¬²¢ÇÒÔÚAutoPostBack´ò¸ö¹´ÊǷdz£ÈÝÒ׵ġ£¶øÕýÊÇÒòΪÈÝÒ×ʹ
Óã¬ËùÒÔ´ó¶à¿ª·¢ÈËÔ±²»»áÈ¥ÏëAutoPostBackÊÇÔõÑùµÄ»úÖÆ¡£Êµ¼ÊÉÏ£¬Èç¹ûÄãÑ¡ÔñAutoPostBack£¬ÔòDropDownList»á±»Ìí¼Ó
Ò»¸öÒý·¢javascriptʼþµÄonchangeÊôÐÔ£¬µ¼ÖÂD ......
Ë®ÏÉ»¨Êý£ºÒ»¸öÈýλÕûÊý¸÷λÊý×ÖµÄÁ¢·½ºÍµÈÓÚ¸ÃÊý±¾Éí¾Í³Æ¸ÃÊýΪˮÏÉ»¨Êý£¬Ë®ÏÉ»¨Êý¹²ÓÐ4¸ö£¬·Ö±ðΪ£º153¡¢370¡¢371¡¢407( ÀýÈ磺1^3 + 5^3 + 3^3 = 153 )¡£ÎÒдµÄ´úÂëÈçÏ£¬ÄãÓÐÆäËûµÄʵÏÖ´úÂëÒ²¿ÉÒÔ·¢±íÆÀÂÛ¡£
int i, m,n,k;
for (i = 100; i < 1000; i++)
{
//È¡µÃ°ÙλÊý
m = i / 100;
//È¡µ ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JqueryAjaxLongPoll.aspx.cs" Inherits="JqueryAjaxLongPoll" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" & ......
ÒòΪ¹«Ë¾µÄ²úÆ·ÓÃasp¿ª·¢£¬ Ç°Ò»¶Îʱ¼äÓÃaspдÁËÒ»¸öÉú³É¾²Ì¬Ò³Ãæ²¢·ÖÒ³µÄ³ÌÐò£¬µ«ÔµÓÚ¶Ô.netµÄÈÈ°®£¬Ð´ÁËÕâ¸ö.netϵÄÉú³É¾²Ì¬Ò³Ãæ²¢·ÖÒ³µÄ³ÌÐò¡£
Ö÷ÒªµÄÔÀí¾ÍÊÇÌ滻ģ°åÀïµÄÌØÊâ×Ö·û¡£
1¡¢¾²Ì¬Ä£°åÒ³Ãæ template.html£¬Ö÷ÒªÊǶ¨ÒåÁËһЩÌØÊâ×Ö·û£¬ÓÃÀ´±»Ìæ»»¡£
<!DOCTYPE HTML PUBLIC "-//W3C//DTD ......
Asp.Net¹¹¼Ü(HttpÇëÇó´¦ÀíÁ÷³Ì) - Part.1
ÒýÑÔ
ÎÒ²éÔĹý²»ÉÙAsp.NetµÄÊé¼®£¬·¢ÏÖ´ó¶àÊý×÷Õ߶¼ÊÇÕ¾ÔÚÒ»¸ö±È½Ï¸ßµÄ²ã´ÎÉϽ²½âAsp.Net¡£ËûÃÇÄÍÐÄ¡¢Ï¸ÖµظæËßÄãÈçºÎÒ»²½²½ÍϷſؼþ¡¢ÉèÖÿؼþÊôÐÔ¡¢±àдCodeBehind´úÂ룬ÒÔʵÏÖij¸öÌض¨µÄ¹¦ÄÜ¡£
ÕâÖÖ×ö·¨£¬Êµ¼ÊÉÏÊǻشðÁË“ÈçºÎÈ¥×ö”µÄÎÊÌ⣬ȴûÓлشð“ÎªÊ ......