Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

I want to detect if my application is running under XP, 2003 or Vista? (I know just one of these, no ther OS)

How can I detect the current version?

I have the following information but don't know how should I compare them?

 

Dim MyVersion As Version = Environment.OSVersion.Version

Dim XPVersion As New Version(5, 1, 0, 0)

Dim ServerVersion As New Version(5, 2, 0, 0)

Dim VistaVersion As New Version(6, 0, 0, 0)

Posted

To make it simple, can I say that this code is correct? I just want to detect Windows Version that's enough:

If Environment.OSVersion.Version.Major = 5 Then
   If Environment.OSVersion.Version.Minor = 1 Then
       'XP
   End If
   If Environment.OSVersion.Version.Minor = 2 Then
       '2003
   End If
End If
If Environment.OSVersion.Version.Major = 6 Then
   'Vista
End If

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...