How to check system default browser?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tee

    #1

    How to check system default browser?

    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


  • Fabien Bezagu

    #2
    Re: How to check system default browser?

    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_US ER\Software\Mic rosoft\Windows\ CurrentVersion\ Explorer\FileEx ts\.html\OpenWi thList

    That's not very elegant but it should work.

    Fabien.


    "Tee" <thy@streamyx.c om> a écrit dans le message de news:
    %233jUgWokFHA.2 152@TK2MSFTNGP1 4.phx.gbl...[color=blue]
    > 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
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: How to check system default browser?

      "Tee" <thy@streamyx.c om> schrieb:[color=blue]
      > 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?[/color]

      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=findassocia tedapp&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.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Tee

        #4
        Re: How to check system default browser?

        Thanks for the help guys.


        "Tee" <thy@streamyx.c om> wrote in message
        news:%233jUgWok FHA.2152@TK2MSF TNGP14.phx.gbl. ..[color=blue]
        > 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
        >[/color]


        Comment

        Working...