禁用F5在web浏览器 [英] Disable F5 in WebBrowser

查看:315
本文介绍了禁用F5在web浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能显示的文件:结果
  禁用浏览器的后退按钮结果
  我如何禁用F5刷新浏览器<? / A>

Possible Duplicates:
Disable browser's back button
How do I disable the F5 refresh on the browser?

我创建了C#应用程序会从互联网上下载的数据(这只是做一次),并把它放在一个网页浏览器,这数据应该是静态的。我想知道,如果有从做一个刷新禁用F5键的方式?

I created an application in C# that will download data from the internet (and this is done one time only) and put it in a webbrowser and this data should be static. I want to know if there is a way to disable the F5 key from doing a refresh?

我试图注入的javascript禁用F5,但它仍然会刷新网页浏览器。

I tried injecting javascript to disable F5 but it will still refresh the webbrowser.

推荐答案

您无法通过JavaScript禁用F5(或其他浏览器的快捷键)。

You cannot disable F5 (or other browser shortcut keys) via JavaScript.

web浏览器控制 WebBrowserShortcutsEnabled 属性设置为要做到你想要做的事。

Setting the WebBrowserShortcutsEnabled property of the WebBrowser control to false should accomplish what you're trying to do.

这篇关于禁用F5在web浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆