WPF WebBrowser控件警告“Intranet设置”(WPF WebBrowser control warns about “Intranet settings”)

编程入门 行业动态 更新时间:2024-10-24 08:29:30
WPF WebBrowser控件警告“Intranet设置”(WPF WebBrowser control warns about “Intranet settings”)

我正在使用WebBrowser控件构建WPF应用程序。 该应用程序在localhost端口上运行一个迷你Web服务器(通过HttpListener),WebBrowser指向它。

当应用程序在Windows7 / IE9上启动时,WebBrowser顶部会出现安全警告:“默认情况下,Intranet安全设置已关闭.Internet网络设置不如Internet设置安全。点击选项...”

我希望我的应用程序不显示该消息。 我能这样做吗? 如果是这样,怎么样?

I'm building WPF app using a WebBrowser control. The app runs a mini web server (via HttpListener) on a localhost port, and the WebBrowser points to it.

When the app starts on Windows7/IE9, there's a security warning at the top of the WebBrowser: "Intranet security settings are now turned off by default. Intranet settings are less secure than Internet settings. Click for options..."

I would like my app not to show that message. Can I do that? If so, how?

最满意答案

感谢safetyOtter,我刚刚添加了此代码来解决问题:

string key = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\localhost"; RegistryKey localhost = Registry.CurrentUser.CreateSubKey(key); localhost.SetValue("http", 1);

Thanks to safetyOtter, I just added this code to fix the problem:

string key = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\localhost"; RegistryKey localhost = Registry.CurrentUser.CreateSubKey(key); localhost.SetValue("http", 1);

更多推荐

本文发布于:2023-08-07 09:36:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463801.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   WebBrowser   WPF   Intranet   settings

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!