locked
browser type using C# RRS feed

  • Question

  • I want to find the browser type in C# Windows Applcaition. Please help.
    Thanks.

    Wednesday, December 23, 2009 5:38 AM

Answers

  • Hi, Coder_Cool:

      Maybe you could refer to the following 3 registry entries to get the default brower setting info.

      “HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\ Associations\UrlAssociations\[ftp|http|https]\UserChoice“

      On my box, I installed IE8, Chorme and Firefox side by side. And when I change my default browser type, the default key value of the  above 3 registry entries changes accordingly, respectively they are:

      IE8: IE.FTP/IE.HTTP/IE.HTTPS
      Chrome: ChromeHTML/ChromeHTML/ChromeHTML
      Firefox: FirefoxURL/FirefoxURL/FirefoxURL

      For a detailed narration, refer to this article.

      About how to manipulate registry in C#, here are some refs:

      1. Registry In's and Out's Using C#
        http://www.developerfusion.com/article/4640/registry-ins-and-outs-using-c/2/
      2. Registry Class
        http://msdn.microsoft.com/en-us/library/microsoft.win32.registry(VS.71).aspx

    Sam
    Thanks.

     

    • Edited by SamAgain Friday, December 25, 2009 2:03 AM refine
    • Marked as answer by eryang Wednesday, December 30, 2009 2:48 AM
    Thursday, December 24, 2009 8:26 AM

All replies


  • and what do you mean by "browser type" ? Atleast your expected set of output from this c# program. [IE/Firefox/Opera/Safari.. is that what you want ?]
    Thanks

    My BlogMy Facebook
    Wednesday, December 23, 2009 7:41 AM
  • yes Omie,
    i need to know whether user has IE / Firefox / opera /safari...
    i am writting an windows applciation , not asp.net .
    Wednesday, December 23, 2009 8:27 AM
  • Hi, Coder_Cool:

      Maybe you could refer to the following 3 registry entries to get the default brower setting info.

      “HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\ Associations\UrlAssociations\[ftp|http|https]\UserChoice“

      On my box, I installed IE8, Chorme and Firefox side by side. And when I change my default browser type, the default key value of the  above 3 registry entries changes accordingly, respectively they are:

      IE8: IE.FTP/IE.HTTP/IE.HTTPS
      Chrome: ChromeHTML/ChromeHTML/ChromeHTML
      Firefox: FirefoxURL/FirefoxURL/FirefoxURL

      For a detailed narration, refer to this article.

      About how to manipulate registry in C#, here are some refs:

      1. Registry In's and Out's Using C#
        http://www.developerfusion.com/article/4640/registry-ins-and-outs-using-c/2/
      2. Registry Class
        http://msdn.microsoft.com/en-us/library/microsoft.win32.registry(VS.71).aspx

    Sam
    Thanks.

     

    • Edited by SamAgain Friday, December 25, 2009 2:03 AM refine
    • Marked as answer by eryang Wednesday, December 30, 2009 2:48 AM
    Thursday, December 24, 2009 8:26 AM
  • Hi ,
    thanks for helping to get the browsers installed int he machine,
    Is it possible to get the version of the browers installed in the machine?
    Please help
    Wednesday, January 13, 2010 10:06 AM