OperatingSystem 클래스

정의

버전 및 플랫폼 식별자 등의 운영 체제에 대한 정보를 나타냅니다. 이 클래스는 상속될 수 없습니다.

public ref class OperatingSystem sealed : ICloneable, System::Runtime::Serialization::ISerializable
public ref class OperatingSystem sealed : ICloneable
public sealed class OperatingSystem : ICloneable, System.Runtime.Serialization.ISerializable
[System.Serializable]
public sealed class OperatingSystem : ICloneable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OperatingSystem : ICloneable, System.Runtime.Serialization.ISerializable
type OperatingSystem = class
    interface ICloneable
    interface ISerializable
[<System.Serializable>]
type OperatingSystem = class
    interface ICloneable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type OperatingSystem = class
    interface ICloneable
    interface ISerializable
Public NotInheritable Class OperatingSystem
Implements ICloneable, ISerializable
Public NotInheritable Class OperatingSystem
Implements ICloneable
상속
OperatingSystem
특성
구현

예제

다음 코드 예제에서는 런 OperatingSystem 타임 운영 체제에 대 한 정보를 표시 하는 개체입니다.

using System;

public class Example
{
   public static void Main()
   {
      var os = Environment.OSVersion;
      Console.WriteLine("Current OS Information:\n");
      Console.WriteLine("Platform: {0:G}", os.Platform);
      Console.WriteLine("Version String: {0}", os.VersionString);
      Console.WriteLine("Version Information:");
      Console.WriteLine("   Major: {0}", os.Version.Major);
      Console.WriteLine("   Minor: {0}", os.Version.Minor);
      Console.WriteLine("Service Pack: '{0}'", os.ServicePack);
   }
}
// If run on a Windows 8.1 system, the example displays output like the following:
//       Current OS Information:
//
//       Platform: Win32NT
//       Version String: Microsoft Windows NT 6.2.9200.0
//       Version Information:
//          Major: 6
//          Minor: 2
//       Service Pack: ''
// If run on a Windows 7 system, the example displays output like the following:
//       Current OS Information:
//
//       Platform: Win32NT
//       Version String: Microsoft Windows NT 6.1.7601 Service Pack 1
//       Version Information:
//          Major: 6
//          Minor: 1
//       Service Pack: 'Service Pack 1'
open System

let os = Environment.OSVersion
printfn "Current OS Information:\n"
printfn $"Platform: {os.Platform:G}"
printfn $"Version String: {os.VersionString}"
printfn $"Version Information:"
printfn $"   Major: {os.Version.Major}"
printfn $"   Minor: {os.Version.Minor}"
printfn $"Service Pack: '{os.ServicePack}'"
// If run on a Windows 8.1 system, the example displays output like the following:
//       Current OS Information:
//
//       Platform: Win32NT
//       Version String: Microsoft Windows NT 6.2.9200.0
//       Version Information:
//          Major: 6
//          Minor: 2
//       Service Pack: ''
// If run on a Windows 7 system, the example displays output like the following:
//       Current OS Information:
//
//       Platform: Win32NT
//       Version String: Microsoft Windows NT 6.1.7601 Service Pack 1
//       Version Information:
//          Major: 6
//          Minor: 1
//       Service Pack: 'Service Pack 1'
Module Example
   Public Sub Main()
      Dim os As OperatingSystem = Environment.OSVersion
      Console.WriteLine("Current OS Information:")
      Console.WriteLine()
      Console.WriteLine("Platform: {0:G}", os.Platform)
      Console.WriteLine("Version String: {0}", os.VersionString)
      Console.WriteLine("Version Information:")
      Console.WriteLine("   Major: {0}", os.Version.Major)
      Console.WriteLine("   Minor: {0}", os.Version.Minor)
      Console.WriteLine("Service Pack: '{0}'", os.ServicePack)
   End Sub
End Module
' If run on a Windows 8.1 system, the example displays output like the following:
'       Current OS Information:
'
'       Platform: Win32NT
'       Version String: Microsoft Windows NT 6.2.9200.0
'       Version Information:
'          Major: 6
'          Minor: 2
'       Service Pack: ''
' If run on a Windows 7 system, the example displays output like the following:
'       Current OS Information:
'
'       Platform: Win32NT
'       Version String: Microsoft Windows NT 6.1.7601 Service Pack 1
'       Version Information:
'          Major: 6
'          Minor: 1
'       Service Pack: 'Service Pack 1'

설명

클래스에는 OperatingSystem 운영 체제에 대한 정보가 포함되어 있습니다.

현재 런타임 운영 체제에 대한 자세한 내용은 속성에서 반환된 OperatingSystem 개체를 Environment.OSVersion 검색합니다. Windows 운영 체제 버전 목록 및 및 VersionString 속성 및 메서드에서 반환된 Version 해당 버전 번호는 ToString운영 체제 버전을 참조하세요.

기본적으로 OperatingSystem 클래스는 운영 체제를 설명하는 범용 수단이 아니며 클래스에서 OperatingSystem 보다 포괄적인 형식을 파생할 수 없습니다. 운영 체제에 대한 다른 정보를 포함할 형식이 필요한 경우 고유한 형식을 만든 다음 형식 OperatingSystem 필드와 필요한 추가 필드, 속성 또는 메서드를 포함합니다.

생성자

OperatingSystem(PlatformID, Version)

지정된 플랫폼 식별자 값 및 버전 개체를 사용하여 OperatingSystem 클래스의 새 인스턴스를 초기화합니다.

속성

Platform

운영 체제 플랫폼을 식별하는 PlatformID 열거형 값을 가져옵니다.

ServicePack

OperatingSystem 개체가 표현하는 서비스 팩 버전을 가져옵니다.

Version

운영 체제를 식별하는 Version 개체를 가져옵니다.

VersionString

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

메서드

Clone()

이 인스턴스와 동일한 OperatingSystem 개체를 만듭니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetObjectData(SerializationInfo, StreamingContext)
사용되지 않음.

이 인스턴스를 역직렬화하는 데 필요한 모든 데이터로 SerializationInfo 개체를 채웁니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsAndroid()

현재 애플리케이션이 Android에서 실행되고 있는지 여부를 나타냅니다.

IsAndroidVersionAtLeast(Int32, Int32, Int32, Int32)

Android 버전(Linux 명령 uname에서 반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsBrowser()

현재 애플리케이션이 브라우저에서 WASM으로 실행되고 있는지 여부를 나타냅니다.

IsFreeBSD()

현재 애플리케이션이 FreeBSD에서 실행되고 있는지 여부를 나타냅니다.

IsFreeBSDVersionAtLeast(Int32, Int32, Int32, Int32)

FreeBSD 버전(Linux 명령 uname에서 반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsIOS()

현재 애플리케이션이 iOS 또는 MacCatalyst에서 실행 중인지 여부를 나타냅니다.

IsIOSVersionAtLeast(Int32, Int32, Int32)

iOS/MacCatalyst 버전(에서 libobjc.get_operatingSystemVersion반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 iOS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsLinux()

현재 애플리케이션이 Linux에서 실행되고 있는지 여부를 나타냅니다.

IsMacCatalyst()

현재 애플리케이션이 Mac Catalyst에서 실행 중인지 여부를 나타냅니다.

IsMacCatalystVersionAtLeast(Int32, Int32, Int32)

≤ 버전 비교를 사용하여 Mac Catalyst 버전(Apple 설명서에 제시된 iOS 버전)을 확인합니다. 지정된 Mac Catalyst 릴리스에 추가된 API를 보호합니다.

IsMacOS()

현재 애플리케이션이 macOS에서 실행되고 있는지 여부를 나타냅니다.

IsMacOSVersionAtLeast(Int32, Int32, Int32)

macOS 버전(에서 libobjc.get_operatingSystemVersion반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 macOS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsOSPlatform(String)

현재 애플리케이션이 지정된 플랫폼에서 실행되고 있는지 여부를 나타냅니다.

IsOSPlatformVersionAtLeast(String, Int32, Int32, Int32, Int32)

운영 체제 버전이 지정된 플랫폼 버전보다 이후 버전이거나 같은지 확인합니다. 이 메서드는 지정된 OS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsTvOS()

현재 애플리케이션이 tvOS에서 실행되고 있는지 여부를 나타냅니다.

IsTvOSVersionAtLeast(Int32, Int32, Int32)

tvOS 버전(에서 libobjc.get_operatingSystemVersion반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 tvOS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsWasi()

현재 애플리케이션이 WASI로 실행되고 있는지 여부를 나타냅니다.

IsWatchOS()

현재 애플리케이션이 watchOS에서 실행되고 있는지 여부를 나타냅니다.

IsWatchOSVersionAtLeast(Int32, Int32, Int32)

watchOS 버전(에서 libobjc.get_operatingSystemVersion반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 watchOS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

IsWindows()

현재 애플리케이션이 Windows에서 실행되고 있는지 여부를 나타냅니다.

IsWindowsVersionAtLeast(Int32, Int32, Int32, Int32)

Windows 버전(에서 RtlGetVersion반환됨)이 지정된 버전보다 크거나 같은지 확인합니다. 이 메서드는 지정된 Windows 버전에 추가된 API를 보호하는 데 사용할 수 있습니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

OperatingSystem 개체의 값을 해당하는 문자열 표현으로 변환합니다.

적용 대상