简体   繁体   English

如何关闭webbrowser信息栏?

[英]How to turn off webbrowser Information Bar?

I am using WPF C# WebBrowser control to navigate a local html file which contains js and css file links, so when my application navigates that local file I get an unwanted security warning information bar, can anyone suggest how to turn it off using C#? 我正在使用WPF C#WebBrowser控件来导航包含js和css文件链接的本地html文件,因此当我的应用程序导航该本地文件时,我会收到一个不需要的安全警告信息栏,有人可以建议如何使用C#将其关闭吗? I know that I can turn it off in IE settings,and can use frame, but I don't want to use frame because I want to have access to HTMLElements. 我知道我可以在IE设置中关闭它,并且可以使用frame,但我不想使用frame因为我想要访问HTMLElements。 any suggestions? 有什么建议?

If it's your file to write and you trust its contents, adding the " mark of the web " silences the security messages. 如果它是您要写的文件并且您信任其内容,则添加“ Web标记 ”会使安全消息静音。 Just add the following line at the top of the html file: 只需在html文件的顶部添加以下行:

<!-- saved from url=(0014)about:internet -->

Note that while the warnings are muted, security isn't compromised -- the page gets to render under IE's Internet security zone rather than get access to local resources. 请注意,虽然警告静音,但安全性不会受到影响 - 页面将在IE的Internet安全区域下呈现,而不是访问本地资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM