﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-loulanlouzhu</title><link>http://www.cnblogs.com/loulanlouzhu/</link><description /><language>zh-cn</language><lastBuildDate>Mon, 08 Sep 2008 00:27:58 GMT</lastBuildDate><pubDate>Mon, 08 Sep 2008 00:27:58 GMT</pubDate><ttl>60</ttl><item><title>中国作出让步 将无限期推迟WAPI标准强制执行</title><link>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/22/7144.html</link><dc:creator>阿勇</dc:creator><author>阿勇</author><pubDate>Thu, 22 Apr 2004 03:13:00 GMT</pubDate><guid>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/22/7144.html</guid><wfw:comment>http://www.cnblogs.com/loulanlouzhu/comments/7144.html</wfw:comment><comments>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/22/7144.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/loulanlouzhu/comments/commentRss/7144.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/loulanlouzhu/services/trackbacks/7144.html</trackback:ping><description><![CDATA[中美两国周三宣布，中国在WAPI标准问题上作出让步，同时将采用严格的反盗版政策，这是中美贸易和技术协议的一部分。中国政府原来将6月1日定为产品包含WAPI的截止日期。WAPI与现有的Wi-Fi安全标准不兼容，强制在设备中包含WAPI将限制中国市场的制造商数量。
<P>
<SCRIPT language=javascript>document.write("<span id=ad_dst"+ad_dst+"></span>");ad_dst = ad_dst+1;</SCRIPT>
<SPAN id=ad_dst2>
<TABLE cellSpacing=4 cellPadding=0 width=350 align=left border=0>
<TBODY>
<TR>
<TD>
<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 height=250 width=350 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME="_cx" VALUE="9260"><PARAM NAME="_cy" VALUE="6615"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="http://images.sohu.com/cs/button/zmh/350250a.swf?clickthru=http://goto.sohu.com/goto.php3?code=zmh-bjfree-itjufu"><PARAM NAME="Src" VALUE="http://images.sohu.com/cs/button/zmh/350250a.swf?clickthru=http://goto.sohu.com/goto.php3?code=zmh-bjfree-itjufu"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="AutoHigh"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1">
<EMBED 
src="http://images.sohu.com/cs/button/zmh/350250a.swf?clickthru=http://goto.sohu.com/goto.php3?code=zmh-bjfree-itjufu" 
quality=autohigh  WIDTH=350 HEIGHT=250 TYPE="application/x-shockwave-flash" 
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED></OBJECT></TD></TR></TBODY></TABLE></SOHUADCODE></SPAN>　　据谈判的消息人士透露，中国同意不在6月1日以前执行WAPI，将无限期地推迟强制执行WAPI。中国还将与IEEE合作修改并完善WAPI。中国副总理吴仪周三和美国贸易官员在华盛顿举行了会谈，中美商贸联合委员会宣布，中国还同意采用新的反盗版政策。</P>
<P>　　中国将针对CD等盗版采取行动，加强对盗版者的犯罪起诉，使中国的法律和国际版权法一致，阻止盗版作品通过互联网传递。美国录音录像产业联合会（RIAA）还呼吁中国开放贸易壁垒，简化审查，以便帮助美国艺术家在中国合法销售产品。周三的协议将能削弱中美在技术贸易领域的紧张局面。</P>
<P>　　中国认为很多制度是为了保障国家安全，但是美国公司认为主要是为了把工作机会吸引到中国，同时得到知识产权。美国芯片制造商抗议说，中国向不在中国生产芯片的企业征收17%的增值税，而在中国生产的芯片最低只要缴纳3%的增值税。</P>
<P>　　Wi-Fi芯片和设备制造商对于中国的安全标准表示迷惑。英特尔首席执行官贝瑞特表示，如果不能找到解决方案，英特尔将在中国停止出售迅驰芯片，Broadcom也采取了类似立场。</P>
<P>　　消息人士表示，双方积极寻求解决WAPI问题，虽然周三的协议不能解决所有问题，但是是积极的一步。&#8220;信息技术产业理事会&#8221;CEO道森表示：&#8220;由于中国是发展最迅速的科技市场，中国同意在国际标准范围内解决问题是一个重要的承诺，美国科技产业希望能帮助中国政府实现这一点。</P><img src ="http://www.cnblogs.com/loulanlouzhu/aggbug/7144.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42135/" target="_blank">[新闻]美大学在网上建虚拟校园开门授课</a>]]></description></item><item><title>Response.Redirect</title><link>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/19/6494.html</link><dc:creator>阿勇</dc:creator><author>阿勇</author><pubDate>Mon, 19 Apr 2004 01:47:00 GMT</pubDate><guid>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/19/6494.html</guid><wfw:comment>http://www.cnblogs.com/loulanlouzhu/comments/6494.html</wfw:comment><comments>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/19/6494.html#Feedback</comments><slash:comments>22</slash:comments><wfw:commentRss>http://www.cnblogs.com/loulanlouzhu/comments/commentRss/6494.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/loulanlouzhu/services/trackbacks/6494.html</trackback:ping><description><![CDATA[<P>大家帮我看看这个是什么道理！</P>
<P>&nbsp;</P>
<P>private void Page_Load(object sender, System.EventArgs e)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Response.Redirect("WebForm3.aspx");<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;catch(System.Exception ee)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Response.Redirect("WebForm2.aspx");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</P>
<P>WebForm3没有错误，为什么还跳到catch</P><img src ="http://www.cnblogs.com/loulanlouzhu/aggbug/6494.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42134/" target="_blank">[新闻]JavaScript将成Silverlight的最大对手?</a>]]></description></item><item><title>怎么通过url传递带？#等特殊字符的参数！</title><link>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/03/5099.html</link><dc:creator>阿勇</dc:creator><author>阿勇</author><pubDate>Sat, 03 Apr 2004 11:16:00 GMT</pubDate><guid>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/03/5099.html</guid><wfw:comment>http://www.cnblogs.com/loulanlouzhu/comments/5099.html</wfw:comment><comments>http://www.cnblogs.com/loulanlouzhu/archive/2004/04/03/5099.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/loulanlouzhu/comments/commentRss/5099.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/loulanlouzhu/services/trackbacks/5099.html</trackback:ping><description><![CDATA[又有哪些特殊字符是不能通过url传递的！<img src ="http://www.cnblogs.com/loulanlouzhu/aggbug/5099.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42133/" target="_blank">[新闻]没有谷歌就活不下去的四个网站</a>]]></description></item><item><title>中国队3-1战胜伊朗</title><link>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4404.html</link><dc:creator>阿勇</dc:creator><author>阿勇</author><pubDate>Sat, 27 Mar 2004 13:28:00 GMT</pubDate><guid>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4404.html</guid><wfw:comment>http://www.cnblogs.com/loulanlouzhu/comments/4404.html</wfw:comment><comments>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4404.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/loulanlouzhu/comments/commentRss/4404.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/loulanlouzhu/services/trackbacks/4404.html</trackback:ping><description><![CDATA[虽然不喜欢足球！不过看到这个消息还是蛮高兴!<img src ="http://www.cnblogs.com/loulanlouzhu/aggbug/4404.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42132/" target="_blank">[新闻]Google 10周岁生日</a>]]></description></item><item><title>第一次来，试发一帖！--ASP.NET 2.0 中的SqlCacheDependency特性</title><link>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4395.html</link><dc:creator>阿勇</dc:creator><author>阿勇</author><pubDate>Sat, 27 Mar 2004 10:55:00 GMT</pubDate><guid>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4395.html</guid><wfw:comment>http://www.cnblogs.com/loulanlouzhu/comments/4395.html</wfw:comment><comments>http://www.cnblogs.com/loulanlouzhu/archive/2004/03/27/4395.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/loulanlouzhu/comments/commentRss/4395.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/loulanlouzhu/services/trackbacks/4395.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中的</SPAN><SPAN lang=EN-US>Page Cache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">是个很有用的东东，只要简单的在页面上方加上一个</SPAN><SPAN lang=EN-US>OutputCache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">标签，就可以让页面在制定的</SPAN><SPAN lang=EN-US>Duration</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">内直接把自动保存在缓存中的页面内容输出，而不需要让</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎再次执行页面代码，当然，节省这点执行时间并不是最主要的理由，主要理由是如果页面内容是从数据库中取出，那么就可以省去连接数据库、取数据的步骤，这个好处可大了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>PageCache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">有点小小的问题，比如，很多</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">论坛的首页就用了</SPAN><SPAN lang=EN-US>PageCache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，所以在一个版里面贴出的最新的帖子并不会马上反映到首页上，而是需要等上一段时间。虽然有点无可奈何，但在某些场合（比如易趣用来显示物品拍卖状态的页面），这种延迟是不允许的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">也即是说，</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">里面的</SPAN><SPAN lang=EN-US>Cache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">并不能自动根据数据库中相应数据发生了变化，而使相应的</SPAN><SPAN lang=EN-US>Cache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">过期，</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中新增的</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">特性使这成为了可能。（当然，只要我们明白了</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中的大致实现方式，我们可以基于</SPAN><SPAN lang=EN-US>ASP.NET 1.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">把这个特点实现出来，后面我总结了相应的方法。）</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">要在</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中应用</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">特性，步骤如下（基于大家手里的</SPAN><SPAN lang=EN-US>Whidbey PDC</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">版本）：</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN lang=EN-US style="COLOR: blue; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">使数据库支持</SPAN><SPAN lang=EN-US style="COLOR: blue">SqlCacheDependency<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>.Net Framework 1.2</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的安装目录下（通常是</SPAN><SPAN lang=EN-US>WINDOWS\Microsoft.NET\Framework\v1.2.30703</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">），有一个</SPAN><SPAN lang=EN-US>aspnet_regsqlcache.exe</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，这个命令行工具让我们的</SPAN><SPAN lang=EN-US>SqlServer 7.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">或者</SPAN><SPAN lang=EN-US>SqlServer 2000</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">能支持</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">特性，</SPAN><SPAN lang=EN-US><BR><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">首先：&#8220;</SPAN><SPAN lang=EN-US>aspnet_regsqlcache &#8211;S </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">服务器名称</SPAN> <SPAN lang=EN-US>&#8211;U </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">登陆</SPAN><SPAN lang=EN-US>ID &#8211;P </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">密码</SPAN> <SPAN lang=EN-US>&#8211;d </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">数据库名称</SPAN> <SPAN lang=EN-US>&#8211;ed</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;，这个命令使指定数据库支持</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">然后我们再加入要追踪的数据表：&#8220;</SPAN><SPAN lang=EN-US>aspnet_regsqlcache &#8211;S </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">服务器名称</SPAN> <SPAN lang=EN-US>&#8211;U </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">登陆</SPAN><SPAN lang=EN-US>ID &#8211;P </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">密码</SPAN> <SPAN lang=EN-US>&#8211;d </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">数据库名称</SPAN> <SPAN lang=EN-US>&#8211;t </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">要追踪的数据表的名称</SPAN> <SPAN lang=EN-US>&#8211;et</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;，这个命令使指定的</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">支持</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">它在幕后做了什么事情呢？</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">首先，它在指定的数据库中新建了一个</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，叫做&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCacheTablesForChangeNotification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;，这个表有三个字段，&#8220;</SPAN><SPAN lang=EN-US>tableName</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;记录要追踪的数据表的名称，&#8220;</SPAN><SPAN lang=EN-US>notificationCreated</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;记录开始追踪的时间，&#8220;</SPAN><SPAN lang=EN-US>changeId</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;是一个</SPAN><SPAN lang=EN-US>int</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">类型的字段，每当追踪的数据表的数据发生变化时，这个字段的值就加</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">它还会在指定的数据库中增加几个存储过程，用来让</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎查询追踪的数据表的情况。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">然后，它会给我们要追踪的</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">加上几个</SPAN><SPAN lang=EN-US>Trigger</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，分别对应到</SPAN><SPAN lang=EN-US>Insert</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Update</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Delete</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">操作，这几个</SPAN><SPAN lang=EN-US>Trigger</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的语句非常简单，就是把&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCacheTablesForChangeNotification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;表中对应&#8220;</SPAN><SPAN lang=EN-US>tableName</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;字段为这个追踪的表的名称的记录的&#8220;</SPAN><SPAN lang=EN-US>changeId</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;字段加上一个</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎通过执行它加上的存储过程&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCachePollingStoredProcedure</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;，这个存储过程直接返回&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCacheTablesForChangeNotification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;表的内容，让</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎知道哪个表的数据发生的变化。默认每</SPAN><SPAN lang=EN-US>500</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">毫秒执行这个存储过程一次，不过可以在</SPAN><SPAN lang=EN-US>web.config</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">里面修改这个间隔时间，我的经验是这个查询操作也是很耗资源的，呵呵。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN lang=EN-US style="COLOR: blue; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="COLOR: blue">web.config</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">配置</SPAN><SPAN lang=EN-US style="COLOR: blue"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US>web.config</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">里面的配置再简单不过了</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;configuration&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;!-- </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">加上合适的数据库连接字符串</SPAN> <SPAN lang=EN-US>--&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;connectionStrings&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;add name="SqlServerConnectionString" <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>connectionString="server=sqlserver1;uid=sa;pwd=<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>password;database=PortalDB " /&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/connectionStrings&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;system.web&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;!-- </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">配置</SPAN><SPAN lang=EN-US>Cache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">一段，使之支持</SPAN><SPAN lang=EN-US>SqlCacheDependency --&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;cache&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;sqlCacheDependency enabled="true" pollTime="500"&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;databases&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;add name=" PortalDB " <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 6">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>connectionStringName=" SqlServerConnectionString " /&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/databases&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/sqlCacheDependency&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/cache&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&lt;/system.web&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;/configuration&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><SPAN lang=EN-US style="COLOR: blue; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">3、<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp; </SPAN></SPAN></SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">在页面上的</SPAN><SPAN lang=EN-US style="COLOR: blue">outputCache</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">标签中指定</SPAN><SPAN lang=EN-US style="COLOR: blue">SqlCacheDependency</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">特性：</SPAN><SPAN lang=EN-US style="COLOR: blue"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>&lt;%@ outputcache duration="9999" varybyparam="None" sqldependency="PortalDB:</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">追踪的数据表名称</SPAN><SPAN lang=EN-US>" %&gt;</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">只要在这个追踪的</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">上执行了</SPAN><SPAN lang=EN-US>Insert</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Update</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Delete</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">操作，数据表上的</SPAN><SPAN lang=EN-US>Trigger</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">就会将数据库中&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCacheTablesForChangeNotification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;表的相应记录的相应&#8220;</SPAN><SPAN lang=EN-US>changId</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;字段值修改，然后</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎就会通过获取新的值来得知追踪的</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的内容发生了变化，自动使这个页面的</SPAN><SPAN lang=EN-US>cache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">失效。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">后话</SPAN><SPAN lang=EN-US style="COLOR: blue">1</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="COLOR: blue">What about Yukon</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">？</SPAN><SPAN lang=EN-US style="COLOR: blue"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">从上面可以知道，</SPAN><SPAN lang=EN-US>SqlServer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">并没有内置自动追踪数据表的数据变化，然后通知</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎的功能（这是肯定的，</SPAN><SPAN lang=EN-US>SqlServer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">都出来</SPAN><SPAN lang=EN-US>N</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">久了），所以</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的开发组人为的加上了定制的</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Trigger</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>StoredProcedure</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">等等来实现数据更改追踪。而</SPAN><SPAN lang=EN-US>Yukon</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">已经不必这么麻烦了，</SPAN><SPAN lang=EN-US>Yukon</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">内置了一个</SPAN><SPAN lang=EN-US>Notification Delivery Service</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">，这个服务会通过</SPAN><SPAN lang=EN-US>WebServer</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>80</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">端口直接通知一个</SPAN><SPAN lang=EN-US>IIS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">内置的监听器，然后这个监听器再通知</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">而且大家可以注意到，上面描述的那种追踪方式只能追踪到表一级的数据更改，即</SPAN><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">引擎最后只能得知某个表的数据发生了更改，而到底是哪一条记录发生了更改，是追踪不到的，而</SPAN><SPAN lang=EN-US>Yukon</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>Notification Delivery Service</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">可以实现记录一级的追踪。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">后话</SPAN><SPAN lang=EN-US style="COLOR: blue">2</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、可以在现在的</SPAN><SPAN lang=EN-US style="COLOR: blue">ASP.NET</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">上实现吗？</SPAN><SPAN lang=EN-US style="COLOR: blue"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">当然可以，我们先按照上面讲的第一个步骤（或者自己定义一套规则来实现在数据库中对</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">数据变化的追踪），依照葫芦画瓢来自己添加上这些</SPAN><SPAN lang=EN-US>Table</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US>Trigger</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">什么的。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US>ASP.NET</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>PageCache</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">有一个</SPAN><SPAN lang=EN-US>VaryByCustom</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">属性的，这个属性可以实现让我们自己定义&#8220;缓存过期&#8221;的规则（确切的说，其实它是可以让我们自定义缓存页的版本，但间接可以实现自定义的缓存&#8220;过期&#8221;啦，呵呵），只要我们在</SPAN><SPAN lang=EN-US>global.asa</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中重写</SPAN><SPAN lang=EN-US>HttpApplication.GetVaryByCustomString()</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">方法，这个方法根据输入的参数字符串，比如&#8220;</SPAN><SPAN lang=EN-US>CheckDBTable=Users</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;，查询数据库中那个&#8220;</SPAN><SPAN lang=EN-US>AspNet_SqlCacheTablesForChangeNotification</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;（或者你自己定义的某个追踪记录表），直接让这个</SPAN><SPAN lang=EN-US>GetVaryByCustomString()</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">方法返回&#8220;</SPAN><SPAN lang=EN-US>changeId</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">&#8221;字段的值即可。</SPAN><SPAN lang=EN-US>VaryByCustom</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的用法</SPAN><SPAN lang=EN-US>MSDN</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">文档上有详细说明。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">后话</SPAN><SPAN lang=EN-US style="COLOR: blue">3</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">、</SPAN><SPAN lang=EN-US style="COLOR: blue">GolfClubShack</SPAN><SPAN style="COLOR: blue; FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">示范程序</SPAN><SPAN lang=EN-US style="COLOR: blue"><BR></SPAN><SPAN lang=EN-US><BR></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">在博客堂前面的某篇文章里面，提供了一个基于</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的</SPAN><SPAN lang=EN-US>GolfClubShack</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">站点的示范程序，是非常好的东东，在那个里面可以看到包括</SPAN><SPAN lang=EN-US>SqlCacheDependency</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">在内的众多</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的特性的体现。现在网上完整的</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的示范程序不多，听说</SPAN><SPAN lang=EN-US>MS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">内部已经把</SPAN><SPAN lang=EN-US>IBuySpy</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">移植到</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">上面了，不知详情如何。而</SPAN><SPAN lang=EN-US>MS</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">还在</SPAN><SPAN lang=EN-US>alpha</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">阶段的</SPAN><SPAN lang=EN-US><A href="http://forums.asp.net/forums"><U>AspNetForums 2.0</U></A></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">还是基于</SPAN><SPAN lang=EN-US>.Net Framework 1.1</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的（我以前一直是以为是基于最新的</SPAN><SPAN lang=EN-US>ASP.NET 2.0</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的，安装了好半天，晕</SPAN><SPAN lang=EN-US>...</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">）。</SPAN></P><img src ="http://www.cnblogs.com/loulanlouzhu/aggbug/4395.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42132/" target="_blank">[新闻]Google 10周岁生日</a>]]></description></item></channel></rss>