2
Answers

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

Ask a question
Jerry Fike

Jerry Fike

7y
217
1
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)