Silverlight 阻止xap包缓存处理

来源:互联网 发布:saas软件合同 编辑:程序博客网 时间:2024/05/21 23:53

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

在Index.aspx中注释掉

<param name="source" value="ClientBin/MyTest.xap"/>

<%    string strSourceFile = @"ClientBin/MyTest.xap";    string param;    if (System.Diagnostics.Debugger.IsAttached)        param = "<param name=\"source\" value=\"" + strSourceFile + "\" />";    else    {        string xappath = HttpContext.Current.Server.MapPath(@""+ @"\" + strSourceFile;        DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath);        param = "<param name=\"source\" value=\"" + strSourceFile + "?ignore="                + xapCreationDate.ToString() + "\" />";    }    Response.Write(param);%>


原创粉丝点击