Results 1 to 3 of 3

Thread: Determine What OS

  1. #1

    Thread Starter
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Question Determine What OS

    I have lots of good VB6 examples, but i haven't seen anything in .NET yet to help me determine what the operating system is that the user is running.

    Anyone have a good way?
    ~Peter


  2. #2
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52
    Option Explicit On
    Option Strict On
    Imports System.Environment
    Module modMain
    Sub Main()
    MsgBox(get_OS_Version)
    End Sub

    Public Function get_OS_Version() As String
    Dim osInfo As OperatingSystem
    osInfo = OSVersion
    With osInfo
    Select Case .Platform
    Case .Platform.Win32Windows
    Select Case (.Version.Minor)
    Case 0
    get_OS_Version = "Win95"
    Case 10
    If .Version.Revision.ToString() = "2222A" Then
    get_OS_Version = "Win98 Second Edition"
    Else
    get_OS_Version = "Win98"
    End If
    Case 90
    get_OS_Version = "WinMe"
    End Select
    Case .Platform.Win32NT
    Select Case (.Version.Major)
    Case 3
    get_OS_Version = "WinNT351"
    Case 4
    get_OS_Version = "WinNT4"
    Case 5
    If .Version.Minor = 0 Then
    get_OS_Version = "Win2K"
    Else
    get_OS_Version = "WinXP"
    End If
    End Select
    Case Else
    get_OS_Version = "Failed"
    End Select
    End With
    End Function
    End Module
    Iouri Boutchkine

  3. #3

    Thread Starter
    Frenzied Member MrGTI's Avatar
    Join Date
    Oct 2000
    Location
    Ontario, Canada
    Posts
    1,277

    Thumbs up

    That works nice. Thanks.

    Now if we could find a way to determine if it was WinXP Pro versus Home, that would be cool.
    ~Peter


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