Results 1 to 17 of 17

Thread: Determine OS Version and Details (includes Vista support)

Threaded View

  1. #12
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Determine OS Version and Details (includes Vista support)

    To expand on this since MS has announced that Windows 7's internal version # is 6.2, here's the function that includes that:
    Code:
        Friend Function GetOSVersion() As String
            Dim strVersion As String = "Unknown"
            Select Case Environment.OSVersion.Platform
                Case PlatformID.Win32S
                    strVersion = "Windows 3.1"
                Case PlatformID.Win32Windows
                    Select Case Environment.OSVersion.Version.Minor
                        Case 0I
                            strVersion = "Windows 95"
                        Case 10I
                            If Environment.OSVersion.Version.Revision.ToString() = "2222A" Then
                                strVersion = "Windows 98 Second Edition"
                            Else
                                strVersion = "Windows 98"
                            End If
                        Case 90I
                            strVersion = "Windows ME"
                    End Select
                Case PlatformID.Win32NT
                    Select Case Environment.OSVersion.Version.Major
                        Case 3I
                            strVersion = "Windows NT 3.51"
                        Case 4I
                            strVersion = "Windows NT 4.0"
                        Case 5I
                            Select Case Environment.OSVersion.Version.Minor
                                Case 0I
                                    strVersion = "Windows 2000"
                                Case 1I
                                    strVersion = "Windows XP"
                                Case 2I
                                    strVersion = "Windows 2003"
                            End Select
                        Case 6I
                            Select Case Environment.OSVersion.Version.Minor
                                Case 0I
                                    strVersion = "Windows Vista"
                                Case 1I
                                    strVersion = "Windows 2008"
                                Case 2I
                                    strVersion = "Windows 7"
                            End Select
                    End Select
                Case PlatformID.WinCE
                    strVersion = "Windows CE"
                Case PlatformID.Unix
                    strVersion = "Unix"
            End Select
            Return strVersion
        End Function
    Last edited by JuggaloBrotha; May 9th, 2009 at 06:32 AM.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width