0

I'm implementing a map that will locate the latitude and longitude of a place and I want to change the cons string key bit in setting up a browser like chrome. In this code telling me that it uses internet explorer and I want to change it to chrome.

   private void SetWebBrowserVersion(int ie_version)
     {
        const string key64bit =
            @"SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\" +
            @"MAIN\FeatureControl\FEATURE_BROWSER_EMULATION";
        const string key32bit =
            @"SOFTWARE\Microsoft\Internet Explorer\MAIN\" +
            @"FeatureControl\FEATURE_BROWSER_EMULATION";
        string app_name = System.AppDomain.CurrentDomain.FriendlyName;

        SetRegistryDword(key64bit, app_name, ie_version);
     }

       DisplayMap(){
       //internet explorer
       SetWebBrowserVersion(11001);
     }


     private void SetRegistryDword(string key_name,
     string value_name, int value)
     {
        RegistryKey key =
            Registry.CurrentUser.OpenSubKey(key_name, true);
        if (key == null)
            key = Registry.CurrentUser.CreateSubKey(key_name,
                RegistryKeyPermissionCheck.ReadWriteSubTree);
        key.SetValue(value_name, value, RegistryValueKind.DWord);
        key.Close();
      }
Cyrille Con Morales
  • 918
  • 1
  • 6
  • 21
  • `I want to change it to chrome.` You can't. – mjwills Aug 19 '19 at 04:08
  • 1
    Maybe try [CefSharp](https://cefsharp.github.io)? – Sweeper Aug 19 '19 at 04:32
  • Possible duplicate of [Options for embedding Chromium instead of IE WebBrowser control with WPF/C#](https://stackoverflow.com/questions/18119125/options-for-embedding-chromium-instead-of-ie-webbrowser-control-with-wpf-c) – Den Aug 19 '19 at 06:00

1 Answers1

1

You can't do that with WebBrowser.

You may want to try BrowseEmAll.Gecko for Firefox or CefSharp for Chrome integration to .NET applications.

Simonas
  • 301
  • 2
  • 12