tags:

views:

35

answers:

3

Hi How can I check if user running my application is running Vista or XP? I need to make it If XP then msgbox "XP" else if Vista then msgbox "Vista" endif

Thanks

A: 

Use System.Environment.OSVersion, http://msdn.microsoft.com/en-us/library/ms724832%28VS.85%29.aspx

Tomas Voracek
A: 

You could take a look at the OSVersion property.

Darin Dimitrov
A: 

Here is the Microsoft KB article on how to do this in C#. The code shouldn't be too hard to translate into VB.NET:

How to determine the Windows version by using Visual C#

Here's a quick attempt at conversion:

Dim osInfo As System.OperatingSystem = System.Environment.OSVersion

Select Case osInfo.Version.Major
    Case 5
        ' Windows 2000 or XP
    Case 6
        ' Windows Vista
End Select
Justin Niessner