简体   繁体   中英

Unsupported browser in visual studio 2010 C#

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 queryaddress = new StringBuilder();

    queryaddress.Append("https://maps.google.com/maps?q=");

    if (lat != string.Empty)
    {
        queryaddress.Append(lat + "," + "+");
    }

    webBrowser1.Navigate(queryaddress.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 is

  • 11001 (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.

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