• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

How to get the browser version with vb.net 2003

vb.net 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.  

Thanks


0
gosonic
Asked:
gosonic
1 Solution
 
Raj_KauCommented:
hi

look this code

http://support.microsoft.com/default.aspx?scid=kb;en-us;311281

 i think thats help you

Raj
0
 
fahimnxbCommented:
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.

Regards,
Me
0
 
HeadspaceCommented:
...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 vb.net.  Let me know, however, if the link doesn't provide enough info and i'll work it out for you.  : )

http://www.codeproject.com/shell/detectie.asp

wil
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
gosonicAuthor Commented:
Headspace,

Yes I am doing it locally and I think your approach will work but I do need assistance in doing in VB.net I don't have any experience in c and don't know how to go about reading those vaules in VB.net - I will appreciate your help on this.
Thanks
0
 
HeadspaceCommented:
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")
regKey.Close()
'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.

wil
0
 
gosonicAuthor Commented:
This is good thank you.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now