1
Windows starts through the registry, looking for a suitable application to open the document with (via explorer.exe).
2
You explicitly tell windows to use xxx.exe to open the document.
Update for a moving target :; -)
, , , Url, , , , , .
, HKEY_CURRENT_USER\Software\Classes\http\shell\open\command # 2.a >
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];
}
URL- #.
string defaultBrowserPath = GetDefaultBrowserPath();
try
{
Process.Start(defaultBrowserPath, "http://www.yahoo.com");
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
URL- #.
// open URL in separate instance of default browser
Process p = new Process();
p.StartInfo.FileName = GetDefaultBrowserPath();
p.StartInfo.Arguments = "http://www.yahoo.com";
p.Start();