本人找了一段清除缓存的代码:
public void ClearIECache()
{
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "/c " + "del /f /s /q \"%userprofile%\\Local Settings\\Temporary Internet Files\\*.*\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
string result = process.StandardOutput.ReadToEnd();
}
在代码中调用了此方法,结果,在VS中浏览网页可以达到清除的效果,而用IIS建站浏览后,却达不到这样的效果,请问各位是什么原因?如何解决
public void ClearIECache()
{
Process process = new Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "/c " + "del /f /s /q \"%userprofile%\\Local Settings\\Temporary Internet Files\\*.*\"";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
string result = process.StandardOutput.ReadToEnd();
}
在代码中调用了此方法,结果,在VS中浏览网页可以达到清除的效果,而用IIS建站浏览后,却达不到这样的效果,请问各位是什么原因?如何解决
解决方案 »
- 問一下,mvc2發佈後,數據庫連接的問題
- dotnetCHARTING.dll控件显示曲线图
- 执行最后一句com.ExecuteNonQuery();报错,急《《《
- ASP.NET中使用DATAGRID绑定数据库并分页显示(二)
- 有一个站点在域里面,怎么样只让域里面的固定几个人访问,而不让其他人访问,谢谢
- 如何在DATAGRID里面显示不是数据库里面的数据,或有别的办法显示不是数据库里面的数据吗?
- 新装的出现这个错,请大家帮忙看一下,谢谢
- [急问].net连接oracle数据库的问题
- 用户控件的疑问?对于大家来说一个非常简单的问题
- datagrid里面AutoGenerateColumns="true"或着不设AutoGenerateColumns,怎么加超级链接。
- ASP.NET 中的对象集合是什么。。。。
- 我想用CSS或js 控制页面中的SWF的大小?高手指点
Response.Buffer = true;
Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
Response.Expires = 0;
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "No-Cache");