Hello, I would like to know how best to display a route from the latitude and longitude that are in the database in a C # Windows Forms application. I've already searched the web and I've found something similar to what I need,
link But I still can not understand much. The code is getting as follows:
using System;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;
namespace GSD
{
public class Class1{
public Class1(){
}
public void AbreGoogleMaps(double _lat1, double _long1, double _lat2, double _long2)
{
string defaultBrowserPath = GetDefaultBrowserPath();
try
{
Process.Start(defaultBrowserPath, string.Format("http://maps.google.com/maps?saddr={0},{1}&daddr={2},{3}", _lat1, _long1, _lat2, _long2));
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
private static string GetDefaultBrowserPath()
{
string key = @"htmlfile\shell\open\command";
RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(key, false);
return ((string)registryKey.GetValue(null, null)).Split('"')[1];
}
}
}