[silverlight是什么]silverlight xap 缓存处理方法

时间:2017-05-01  来源:Silverlight  阅读:

在Index.aspx中注释掉

 代码如下

增加如下C#代码:

 

 代码如下 <%
            //2011.11.07 修改 解决xap缓存问题
            string strSourceFile = @"ClientBin/xxxxxx.xap";
            string param;
            if (System.Diagnostics.Debugger.IsAttached)
                param = "";
            else
            {
                string xappath = HttpContext.Current.Server.MapPath(@"") + @"" + strSourceFile;
                DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath);
                param = "";
            }
            Response.Write(param);
          %>

即可实现当xap有更新的时候立刻通过xap文件的最后修改时间来判断是否是新生成的xap,从而控制是读取缓存中的xap还是下载服务器上的xap。

参考:http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/#comment-20

 

[silverlight是什么]silverlight xap 缓存处理方法

http://m.bbyears.com/asp/32320.html

推荐访问:silverlight和wpf silverlight开发 silverlight下载
相关阅读 猜你喜欢
本类排行 本类最新