简体   繁体   中英

How do I get rid of the ActiveX warning in a VB.NET application using the WebBrowser control?

We have a VB.Net app that has several editable reports and forms in html/javascript. I'm using the standard WebBrowser control.

We're accessing the content via filepath, since using \\localhost\\sharename when the machine is offline doesn't work even though the content is on the machine. The problem with that is that then it's running in the local machine zone, and you get the warning about running ActiveX controls (even if that's set to 'allow' in the options menu on IE).

So I'm using Mark of the Web to act as if the content is saved from localhost. I appended it with the requisite vbCrLf to the start of the HTML page that's being dynamically written every time a link is clicked. When I open the resulting page in IE, I no longer get the ActiveX warning, and everything works. However, when I use WebBrowser.Navigate to that filepath, I still get the warning. Any idea how to get rid of that?

尝试通过将webbrowser的ScriptErrorsSuppressed属性设置为true,我认为这将解决您的问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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