How to get the browser version with 2003

Posted on 2006-03-20
Last Modified: 2010-05-18 2003 (windows forms)

I am using  
  IEs As New SHDocVw.ShellWindows
  IE As SHDocVw.InternetExplorer

How do I determine which version of IE is being used here?  With the new IE7 beta being released it is important that I know if the user has upgraded.  


Question by:gosonic
    LVL 3

    Expert Comment


    look this code;en-us;311281

     i think thats help you

    LVL 5

    Expert Comment

    Dear gosonic,

    Its very simple to write a code for getting browser information. All you need to do is using the HttpBrowserCapabilities class provided in .NET framework.

    Following is the code sample.

    Dim bc as HttpBrowserCapabilities
    bc = Request.Browser
    Response.Write("Type = " + bc.Type + "<br>");
    Response.Write("Name = " + bc.Browser + "<br>");
    Response.Write("Version = " + bc.Version + "<br>");

    Let me know if you face any problems or if you require further information.

    LVL 9

    Expert Comment

    ...well, since you're obviously doing this locally, my vote would be to get the installed version of ie from the registry.  However, i found this example that also explains the use of shdocvw.dll (which is still valid for ie 6 versions).  The example is in c, but it should give you enough to go in in  Let me know, however, if the link doesn't provide enough info and i'll work it out for you.  : )


    Author Comment


    Yes I am doing it locally and I think your approach will work but I do need assistance in doing in I don't have any experience in c and don't know how to go about reading those vaules in - I will appreciate your help on this.
    LVL 9

    Accepted Solution

    ok...I'll go with the registry option, since it's super easy to do:

    'add the Microsoft.Win32 namespace:
    Imports Microsoft.Win32

    'and within the appropriate sub:
    Dim regKey As RegistryKey
    regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Internet Explorer", False)
    Dim val as String = regKey.GetValue("Version")
    'do something with val here

    IE 5 and up also provide a 'build' value in the registry, which may or may not be important to your application.  I'm assuming that you likely won't be dealing with any versions older than 5 (since this is a .net app).  If you'd like an example using the shdocvw.dll, just let me know.


    Author Comment

    This is good thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now