This documentation is archived and is not being maintained.

Environment.Version Property

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.

[Visual Basic]
Public Shared ReadOnly Property Version As Version
[C#]
public static Version Version {get;}
[C++]
public: __property static Version* get_Version();
[JScript]
public static function get Version() : Version;

Property Value

A Version object.

Example

[Visual Basic] 
' Sample for the Environment.Version property
Imports System

Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      Console.WriteLine("Version: {0}", Environment.Version.ToString())
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'(Any result that is lengthy, specific to the machine on which this sample was tested, 
'or reveals information that should remain secure, has been omitted 
'and marked "!---OMITTED---!".)
'
'Version: !---OMITTED---!
'

[C#] 
// Sample for the Environment.Version property
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine();
    Console.WriteLine("Version: {0}", Environment.Version.ToString());
    }
}
/*
This example produces the following results:
(Any result that is lengthy, specific to the machine on which this sample was tested, or reveals information that should remain secure, has been omitted and marked "!---OMITTED---!".)

Version: !---OMITTED---!
*/

[C++] 
// Sample for the Environment::Version property
#using <mscorlib.dll>

using namespace System;

int main() {
   Console::WriteLine();
   Console::WriteLine(S"Version: {0}", Environment::Version);
}
/*
This example produces the following results:
(Any result that is lengthy, specific to the machine on which this sample was tested, or reveals information that should remain secure, has been omitted and marked S"!---OMITTED---!".)

Version: !---OMITTED---!
*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Environment Class | Environment Members | System Namespace

Show: