How to check system default browser?

  • Thread starter Thread starter Tee
  • Start date Start date
T

Tee

Hi,

I need to open a .xml file with system default browser.
But whenever I open the file using Process.Start, it will open the default
program that handles .xml.

Anyone knows how to detect the default browser so I can use it to open the
..xml?


Thanks,
Tee
 
Tee,

One idea would be to read the registry the application handling the file
type htm or html. With Windows XP, this registry key is (for html files)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\OpenWithList

That's not very elegant but it should work.

Fabien.
 
Tee said:
I need to open a .xml file with system default browser.
But whenever I open the file using Process.Start, it will open the default
program that handles .xml.

Anyone knows how to detect the default browser so I can use it to open the
.xml?

You could determine the application which is associated with the ".html"
extension, for example:

Determining a file's associated application
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=findassociatedapp&lang=en>

'Process.Start(<file name>)' will open the application associated with the
file type of the file you pass to the 'Start' method automatically.
 
Back
Top