次の方法で共有


Environment.Version プロパティ

共通言語ランタイムのメジャー バージョン番号、マイナ バージョン番号、ビルド番号、およびリビジョン番号を記述する Version オブジェクトを取得します。

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;

プロパティ値

Version オブジェクト。

使用例

 
' 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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET, Common Language Infrastructure (CLI) Standard

参照

Environment クラス | Environment メンバ | System 名前空間