问题描述
我一直在谷歌上搜索了几个小时,试图弄清楚这一点,我只是不能。
我有一个形式,webbrowser1 1 WebBrowser控件。
I have been googling for hours and trying to figure this out, and I just can't.I have 1 webbrowser control on a form, webbrowser1.
在我打开一个页面,说google.com,如果我用 webbrowser1.refresh()
或 WebBrowser1.Navigate时(google.com )
,它没有重新加载页面,它有它高速缓存,所以它只是重新加载缓存。这是非常明显的特别是在像论坛或Craigslist的页面。
Once I load a page, say google.com, if I use webbrowser1.refresh()
or webbrowser1.navigate("google.com")
, it's not reloading the page, it has it cached so it's just reloading the cache. This is terribly apparent especially on pages like forums or craigslist.
我需要清除每次刷新(不理想)或禁用缓存之间的高速缓存都在一起,任何想法?我发现的唯一的东西是过时的(VB6或更低)。
I need to clear the cache between each refresh (not ideal) or disable caching all together, any ideas? The only things I've found are outdated (vb6 or lower).
推荐答案
您可以尝试调用 webbrowser1.Refresh(WebBrowserRefreshOption.Completely)
。它应该刷新页面,显示最新的版本,像CTRL + F5在IE中。请参见和的更多信息。
You could try to call webbrowser1.Refresh(WebBrowserRefreshOption.Completely)
. It should refresh the page and show the latest version, something like ctrl+F5 in IE. See here and here more info.
这篇关于如何在.NET WebBrowser控件禁用缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!