Operating System Version in VB.NET

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

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())
    End Sub

End Module

The output will look like following:



More Articles

© 2020 DotNetHeaven. All rights reserved.