Visual Studio 2010中不受支持的浏览器C# [英] Unsupported browser in visual studio 2010 C#
问题描述
我想在Google地图上显示GPS坐标。为此,我从工具箱中选择了Web浏览器。但它显示不支持的浏览器的错误。我试图更新我的Internet Explorer。
我也将Google Chrome设置为Visual Studio中的调试浏览器,但无效。
这是我访问网络的代码部分浏览器。
try
{
StringBuilder querryaddress = new StringBuilder();
querryaddress.Append(https://maps.google.com/maps?q=);
if(lat!= string.Empty)
{
querryaddress.Append(lat +,++);
}
webBrowser1.Navigate(querryaddress.ToString());
}
catch(Exception ex)
{
MessageBox.Show(ex.Message.ToString(),Error);
}
错误
您似乎正在使用不受支持的浏览器。旧版浏览器可能会将您的
安全性置于风险之中,速度很慢,并且不适用于较新的Google Maps
功能。要访问Google地图,您需要更新到现代的
浏览器。
最好的方法是 WebBrowser
您的计算机上的旧版Internet Explorer:
默认情况下,此功能针对Windows Internet Explorer启用,
针对应用程序启用托管WebBrowser
控件。要通过使用注册表来禁用此
功能,请将您的可执行文件的名称添加到
以下设置。
<
HKEY_LOCAL_MACHINE(或HKEY_CURRENT_USER)
软件
Microsoft
Internet Explorer
主要
FeatureControl
FEATURE_BEHAVIORS
contoso.exe =(DWORD)< VALUE>
其中 VALUE
是
-
11001(0x2AF9)
Internet Explorer 11.网页以IE11
边缘模式显示,不管声明的!DOCTYPE指令如何。
无法声明!DOCTYPE指令导致页面加载到怪癖中。 -
11000(0x2AF8)
IE11。包含基于标准的!DOCTYPE
伪指令的网页以IE11边缘模式显示。 IE11的默认值。
-
10001(0x2711)
Internet Explorer 10.网页显示在IE10
标准模式下,无论!DOCTYPE指令。
-
10000(0x02710)
Internet Explorer 10.包含
基于标准的!DOCTYPE指令的网页以IE10标准
模式显示。 Internet Explorer 10的默认值。 -
9999(0x270F)
Windows Internet Explorer 9.网页显示在
中IE9标准模式,而不管声明的!DOCTYPE指令。
无法声明!DOCTYPE指令会导致页面加载到
Quirks中。 -
9000(0x2328)
Internet Explorer 9.包含
基于标准的!DOCTYPE指令的网页以IE9模式显示。
Internet Explorer 9的默认值。重要在Internet
Explorer 10中,包含基于标准的!DOCTYPE指令
的网页显示在IE10标准模式中。 -
8888(0x22B8)
无论声明的!DOCTYPE指令如何,网页都以IE8标准模式显示
。无法声明
!DOCTYPE指令会导致页面加载到怪癖中。
-
8000(0x1F40)
包含基于标准的!DOCTYPE指令
的网页在IE8模式下显示。 Internet Explorer 8的默认值
重要在Internet Explorer 10中,包含
基于标准!!DOCTYPE指令的网页显示在IE10标准
模式中。 -
7000(0x1B58)
包含基于标准的!DOCTYPE指令
的网页在IE7标准模式下显示。
托管WebBrowser控件的应用程序的默认值。
$ b关注 msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx#browser_emulationrel =nofollow>这篇文章了解更多详情。
I want to display GPS coordinates on Google Maps. For this purpose I chose web browser from the toolbox. But it show an error of unsupported browser. I tried updating my Internet Explorer. I also set Google Chrome as the Debugging Browser in Visual Studio but it didn't work.
This is the part of code where I am accessing the web browser.
try { StringBuilder querryaddress = new StringBuilder(); querryaddress.Append("https://maps.google.com/maps?q="); if (lat != string.Empty) { querryaddress.Append(lat + "," + "+"); } webBrowser1.Navigate(querryaddress.ToString()); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString(), "Error"); }
Error
You seem to be using an unsupported browser. Old browsers can put your security at risk, are slow and don't work with newer Google Maps features. To access Google Maps, you'll need to update to a modern browser.
What is the best way to do this.?
解决方案You are getting this message since the
WebBrowser
control is emulating an older version of Internet Explorer on your machine:By default, this feature is enabled for Windows Internet Explorer and for applications hosting the
WebBrowser
Control. To disable this feature by using the registry, add the name of your executable file to the following setting.This can be changed via Registry settings:
HKEY_LOCAL_MACHINE (or HKEY_CURRENT_USER) SOFTWARE Microsoft Internet Explorer Main FeatureControl FEATURE_BEHAVIORS contoso.exe = (DWORD) <VALUE>
where
VALUE
is11001 (0x2AF9)
Internet Explorer 11. Webpages are displayed in IE11 edge mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.11000 (0x2AF8)
IE11. Webpages containing standards-based !DOCTYPE directives are displayed in IE11 edge mode. Default value for IE11.10001 (0x2711)
Internet Explorer 10. Webpages are displayed in IE10 Standards mode, regardless of the !DOCTYPE directive.10000 (0x02710)
Internet Explorer 10. Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode. Default value for Internet Explorer 10.9999 (0x270F)
Windows Internet Explorer 9. Webpages are displayed in IE9 Standards mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.9000 (0x2328)
Internet Explorer 9. Webpages containing standards-based !DOCTYPE directives are displayed in IE9 mode. Default value for Internet Explorer 9. Important In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.8888 (0x22B8)
Webpages are displayed in IE8 Standards mode, regardless of the declared !DOCTYPE directive. Failing to declare a !DOCTYPE directive causes the page to load in Quirks.8000 (0x1F40)
Webpages containing standards-based !DOCTYPE directives are displayed in IE8 mode. Default value for Internet Explorer 8 Important In Internet Explorer 10, Webpages containing standards-based !DOCTYPE directives are displayed in IE10 Standards mode.7000 (0x1B58)
Webpages containing standards-based !DOCTYPE directives are displayed in IE7 Standards mode. Default value for applications hosting the WebBrowser Control.
Follow this article for a more details.
这篇关于Visual Studio 2010中不受支持的浏览器C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!