OperatingSystem.VersionString 속성

정의

운영 체제에 현재 설치된 플랫폼 식별자, 버전 및 서비스 팩의 연결된 문자열 표현을 가져옵니다.

public:
 property System::String ^ VersionString { System::String ^ get(); };
public string VersionString { get; }
member this.VersionString : string
Public ReadOnly Property VersionString As String

속성 값

Platform, VersionServicePack 속성이 반환하는 값의 문자열 표현입니다.

예제

다음 코드 예제는 VersionString 속성입니다.

// This example demonstrates the VersionString property.
using namespace System;
int main()
{
   OperatingSystem^ os = Environment::OSVersion;
   
   // Display the value of OperatingSystem.VersionString. By default, this is
   // the same value as OperatingSystem.ToString.
   Console::WriteLine( L"This operating system is {0}", os->VersionString );
   return 0;
}

/*
This example produces the following results:

This operating system is Microsoft Windows NT 5.1.2600.0 Service Pack 1
*/
// This example demonstrates the VersionString property.
using System;

class Sample
{
    public static void Main()
    {
    OperatingSystem os = Environment.OSVersion;
// Display the value of OperatingSystem.VersionString. By default, this is
// the same value as OperatingSystem.ToString.
    Console.WriteLine("This operating system is {0}", os.VersionString);
    }
}
/*
This example produces the following results:

This operating system is Microsoft Windows NT 5.1.2600.0 Service Pack 1
*/
// This example demonstrates the VersionString property.
open System

let os = Environment.OSVersion
// Display the value of OperatingSystem.VersionString. By default, this is
// the same value as OperatingSystem.ToString.
printfn $"This operating system is {os.VersionString}"
// This example produces the following results:
//    This operating system is Microsoft Windows NT 5.1.2600.0 Service Pack 1
' This example demonstrates the VersionString property.
Class Sample
   Public Shared Sub Main()
      Dim os As OperatingSystem = Environment.OSVersion

' Display the value of OperatingSystem.VersionString. By default, this is
' the same value as OperatingSystem.ToString.

      Console.WriteLine("This operating system is {0}", os.VersionString)

   End Sub
End Class
'
'This example produces the following results:
'
'This operating system is Microsoft Windows NT 5.1.2600.0 Service Pack 1

설명

기본적으로 에서 반환 VersionString 되는 값은 메서드에서 반환된 값과 ToString 동일합니다. 그러나 다른 플랫폼에 대한 .NET Framework 구현하면 해당 플랫폼에 더 적합한 문자열을 반환할 수 있습니다.

Windows 운영 체제 버전 및 해당 버전 번호 목록은 운영 체제 버전을 참조하세요.

적용 대상

추가 정보