Find Operating System Information from your VB.NET 2005 application

In VS 2005, it has become really easy to find the Operating System's information using some of the classes. Let's take a look at how do we do it in VB 2005...

    Sub DisplayOperatingSystemInformation()
Dim osInfo As OperatingSystem
osInfo = Environment.OSVersion
Dim verInfo As Version
verInfo = osInfo.Version
'Display Version Information
MessageBox.Show( _
"Major Version = " & verInfo.Major & vbCrLf & _
"Minor Version = " & verInfo.Minor & vbCrLf & _
"Revision = " & verInfo.Revision & vbCrLf & _
"Build = " & verInfo.Build & vbCrLf & _
"Platform = " & osInfo.Platform & vbCrLf & _
"Platform String = " & osInfo.VersionString, _
"Operating System Information", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
End Sub

Here is the output of this Method...

Cheers
-Rahul Soni

OSI.GIF