Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

OSVersion Property

Location

My.Computer.Info.OSVersion

Syntax

Dim result As String = My.Computer.Info.OSVersion

Description

The OSVersion property returns the version of the operating system, a set of four numbers in the format "major.minor.build.revision."

Usage at a Glance

  • This property is read-only.

  • An exception is thrown if the user does not have sufficient security privileges to access system information.

Example

The text returned by this property varies by operating system and installed features. For instance, the text returned for a sample Windows XP Professional system with Service Pack 2 and several hot fixes installed was "5.1.2600.131072."

Related Framework Entries

  • Microsoft.VisualBasic.Devices.ComputerInfo.OSFullName Property

  • System.Environment.OSVersion Property

  • System.OperatingSystem.Version Property

See Also

Info Object (My.Computer), OSFullName Property, OSPlatform Property

Категории