Asp.NetʹÓÃCache
ÐÄÓêÖ®¼Ò
Cache ¼´¸ßËÙ»º´æ £¬ÎÒÏëºÜ¶àÈ˶ÔËûµÄµÚÒ»Ó¡ÏóÒ»¶¨ÏñÎÒÒ»Ñù£¬¸Ð¾õËûÒ»¶¨ÄÜÌá¸ßϵͳµÃÐÔÄܺÍÔËÐÐËٶȡ£µÄÈ·¡£NetÍƳöcacheµÄ³õÖÔȷʵÊÇÕâÑùµÄ¡£ÄÇôcacheÊÇÈçºÎÌá¸ßϵͳÐÔÄÜÓëÔËÐÐËÙ¶ÈÄØ£¿ÊDz»ÊÇÔÚÈκÎÇé¿öÏÂÓÃcache¶¼ÄÜÌá¸ßÐÔÄÜ£¿ÊDz»ÊÇcacheÓõÄÔ½¶à¾ÍÔ½ºÃÄØ£¿ÎÒÔÚ½üÆÚ¿ª·¢µÄÏîÄ¿ÖÐÓÐËùÌå»á£¬Ð´ÏÂÀ´µ±×÷×ܽáҲϣÍûÄܸú´ó¼ÒÒ»Æð̽ÌÖ̽ÌÖ£¬ÓдíÎóµÄµØ·½Ï£Íû´ó¼ÒÅúÆÀÖ¸Õý¡£
1. Cache ÊÇÈçºÎ¹¤×÷µÄ¡£
l Cache ÊÇ·ÖÅäÔÚ·þÎñÆ÷ÉϵÄÒ»¸ö¹«¹²µÄÄÚ´æƬ¡£
Ëùν¹«¹²Ö¸µÄcacheÖ»ÒªÒ»´´½¨ÊÇÈκÎÒ»¸ö¿Í»§¶Ëä¯ÀÀÆ÷¶¼¿ÉÒÔͨ¹ýºǫ́´úÂë·ÃÎʵ½Ëü£¬ËüÃæÏòµÄÊÇËùÓÐÓû§£¬Ïà¶Ô¶øÑÔsessionÒ²ÊÇ·þÎñÆ÷ÉϵÄÒ»¶ÎÄڴ棬µ«ËûÃæÏòµÄÊǵ¥¸öÓû§¡£ËüÊÇ·þÎñÆ÷µÄÒ»¶ÎÄÚ´æ¿é£¬Ò²¾ÍÊÇ˵ÿ¸öcacheÒ»¾´´½¨¾ÍÕ¼ÓÃÁË·þÎñÆ÷×ÊÔ´µÄ¡£ËùÒÔ´ÓÕâµãÀ´ËµÎÒÃǾͿÉÒÔ˵£º²¢²»ÊÇcacheÔ½¶àÔ½ºÃ¡£
l cache ÊÇÓÐʱ¼äÏÞÖƵģ¬³¬¹ýÁË·þÎñÆ÷É趨µÄ¹ýÆÚʱ¼ä£¬Ëü¾Í»á±»·þÎñÆ÷»ØÊÕ¡£
l c.cache ¿ÉÒÔ´æ·ÅÈκζÔÏó
2. Cache ÈçºÎ´´½¨ÒÔ¼°ÈçºÎÏú»Ù¡£
l ´´½¨cache
ÔÚ¡£Net»·¾³ÏÂͨ¹ýCache.Insert(string key,object o)·½·¨´´½¨¡£ÆäÖÐkey ´ú±ícacheµÄID,o´ú±í´æµ½cacheÀïµÄ¶ÔÏó¡£
l Ïú»Ùcache.
ͨ¹ý·½·¨Cache.Remove(string key)ÆäÖÐkey ´ú±ícacheµÄ ID.
l µ÷ÓÃcache.
CacheÖ§³Ö×°Ïä/²ðÏä²Ù×÷¡£ÈçÄã¿ÉÒÔ°ÑÒ»¸öDataSet¶ÔÏódsͨ¹ýCache.Insert(“dsCache”,ds)µÄ·½Ê½´æµ½CacheÖУ¬¿ÉÒÔͨ¹ý²ðÏä²Ù×÷ DataSet ds = (DataSet)Cache[“dsCache”]À´·ÃÎÊËü¡£
3. ʲôʱºòÓÃcache.
Cache Ò»°ãÓÃÓÚÊý¾Ý½Ï¹Ì¶¨£¬ÓõĽÏƵ·±µÄµØ·½¡£ÀýÈç¿ÉÒ԰ѽøÏú´æϵͳÖпÉÒ԰ѲúÆ·ÐÅÏ¢´æÈëcache,ÔÚÓû§µ÷ÓòúÆ·ÐÅϢʱͨ¹ýµ÷ÓÃcache¼´¿É£¬ÕâÑù´ÓºÜ´ó³Ì¶ÈÉϼõÉÙÁËÓû§ÓëÊý¾Ý¿âµÄ½»»¥£¬Ìá¸ßÁËϵͳµÄÐÔÄÜ¡£·´Ö®£¬cache²»ÊʺÏÓÃÔÚÊý¾Ý±ä¶¯¿ì£¬Ê¹Ó÷¶Î§ºÜյĵط½¡£ÀýÈç°ÑÒ»¸ö¾ßÌå²É¹ºµ¥´æÈë cacheÖС£
4. cache µ÷ÓÃ×¢ÒâÊÂÏî¡£
CacheÊÇÓÐʱ¼
Ïà¹ØÎĵµ£º
ASP.NETÖжà¹úÓïÑÔµÄʵÏÖ
http://www.cnblogs.com/firstyi/archive/2008/03/13/1103970.html
ASP.NET»º´æÌá¸ßÕ¾µãÐÔÄÜ
http://www.cnblogs.com/firstyi/archive/2007/08/15/856676.html
¿Í»§¶Ë½Å±¾¹ÜÀí
http://www.cnblogs.com/firstyi/archive/2006/11/13/559049.html ......
1£º¿Í»§¶Ë
<table border="0" style="width: 60%">
¡¡¡¡<tr><td colspan="2" style="height: 5px">
Êý¾Ý¿â»¹ÔºÍ±¸·Ý:</td></tr>
¡¡¡¡<tr><td style="width: 171px; height: 23px;">
ÇëÑ¡ÔñÊý¾Ý¿â:</t ......
×Ô¶¨Òå¿Ø¼þÖеÄÒ³Ãæ´úÂ룺
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
t ......
ÐèÒªÓõ½µÚÈý·½¿Ø¼þICSharpCode.SharpZipLib.dll
using System.IO;
using System.IO.Compression;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Checksums;
#region ѹËõÎļþ¼Ð,Ö§³ÖµÝ¹é
/// <summary>
&nb ......
µÚÒ»ÖÖ·½·¨£º
ͨ¹ýURLÁ´½ÓµØÖ·´«µÝ
send.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?username=honge");
&n ......