Operating System Version in VB.NET

How to get operating system version information in VB.NET.
  • 4868

The following code snippet displays your Operating System version, SP, and platform details by using the OperatingSystem object and its members.

Module Module1

    Sub Main()
        Console.WriteLine("Operating System Detaiils")
        Dim os As OperatingSystem = Environment.OSVersion
        Console.WriteLine("OS Version: " + os.Version.ToString())
        Console.WriteLine("OS Platoform: " + os.Platform.ToString())
        Console.WriteLine("OS SP: " + os.ServicePack.ToString())
        Console.WriteLine("OS Version String: " + os.VersionString.ToString())
        Console.ReadLine()
    End Sub

End Module


The output will look like following:

OsImg1.jpg

Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.