2
Reply

Starting Default Browser with a Local File from a C# WFA app

Jerry Fike

Jerry Fike

Jan 21 2017 1:17 PM
197
I've been trying to make an application I'm working on launch my default browser and load a local help file.  The code I'm using is:
 
string target = @"timers.htm";
try
{
   System.Diagnostics.Process.Start(target);
}
catch
(
   System.ComponentModel.Win32Exception noBrowser)
{
   if (noBrowser.ErrorCode == -2147467259)
   MessageBox.Show(noBrowser.Message);
}
   catch (System.Exception other)
{
   MessageBox.Show(other.Message);
}
 
This works fine if I use IE or Edge as my default browser, but I really want to use Chrome. But with Chrome set as the default browser, it launches but gives me a "file not found" error.  
 
I suspect I'm missing something simple here but can't seem to track it down.  Can anyone help me with this?
 
Thanks, Jerry 

Answers (2)