0

I have a problem with the location of google maps in my C# winforms application.

I get always this message "You seem to be using an unsupported browser." By Internet explorer - Compatibility View I removed google.it and google.com but the problem persists.

The code I used is as follows:

private void Btn_Localizza_Click(object sender, EventArgs e)
{
   string street = txt_IndirizzoAZ.Text;
   string city = cbo_ComuneAZ.Text;
   string state = cbo_StatoAZ.Text;
   string zip = cbo_CapAZ.Text;


   try
   {
       StringBuilder add = new StringBuilder("http://maps.google.com/maps?q=");

       add.Append(street);
       add.Append(city);
       add.Append(state);
       add.Append(zip);
       webBrowser1.Navigate(add.ToString());


       if (street != string.Empty) {add.Append(street + "," + "+");}
       if (city != string.Empty) {add.Append(city + "," + "+");}
       if (state != string.Empty) {add.Append(state + "," + "+");}
       if (zip != string.Empty) { add.Append(zip + "," + "+"); }

       webBrowser1.Navigate(add.ToString());
   }
   catch (Exception ex)
   {
       MessageBox.Show(ex.Message + " Si รจ verificato un errore durante la geolocalizzazione dell'azienda." +
           " Contattare l'amministratore", "ERRORE", MessageBoxButtons.OK, MessageBoxIcon.Error);
   }

}

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147

1 Answers1

0

Maybe changing the user agent string to something that google considers Supported?

I'm sure the embedded object is calling Internet Explorer from the system to render it, so it could be more or less safe to consider that if the current windows IE is supported by google maps then your app will too.

Community
  • 1
  • 1
Gustavo Rubio
  • 10,209
  • 8
  • 39
  • 57