My.Computer.Info.OSVersion Property
Gets the version of the computer's operating system.
' Usage
Dim value As String = My.Computer.Info.OSVersion
' Declaration
Public ReadOnly Property OSVersion As String
Return Value
A String containing the current version number of the operating system.
Exceptions
The following condition can cause an exception:
- The application cannot obtain the operating-system version information (ExecutionEngineException).
Remarks
The My.Computer.Info.OSVersion property formats the version as "major.minor.build.revision".
The My.Computer.Info.OSVersion property provides functionality similar to the Version property of the object returned by the OSVersion property.
Example
This example uses the My.Computer.Info.OSVersion property to display the version of the computer's operating system.
MsgBox("Computer's operating system version: " & _
My.Computer.Info.OSVersion)
Requirements
Namespace: Microsoft.VisualBasic.Devices
Class: ComputerInfo
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)
Availability by Project Type
Project type | Available |
---|---|
Windows Application |
Yes |
Class Library |
Yes |
Console Application |
Yes |
Windows Control Library |
Yes |
Web Control Library |
Yes |
Windows Service |
Yes |
Web Site |
Yes |
Permissions
No permissions are required.
See Also
Reference
My.Computer.Info Object
Microsoft.VisualBasic.Devices.ComputerInfo.OSVersion