OperatingSystem 클래스
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
버전 및 플랫폼 식별자 등의 운영 체제에 대한 정보를 나타냅니다. 이 클래스는 상속될 수 없습니다.
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 필드와 필요한 추가 필드, 속성 또는 메서드를 포함합니다.
Operating |
지정된 플랫폼 식별자 값 및 버전 개체를 사용하여 OperatingSystem 클래스의 새 인스턴스를 초기화합니다. |
Platform |
운영 체제 플랫폼을 식별하는 PlatformID 열거형 값을 가져옵니다. |
Service |
이 OperatingSystem 개체가 표현하는 서비스 팩 버전을 가져옵니다. |
Version |
운영 체제를 식별하는 Version 개체를 가져옵니다. |
Version |
운영 체제에 현재 설치된 플랫폼 식별자, 버전 및 서비스 팩의 연결된 문자열 표현을 가져옵니다. |
Clone() |
이 인스턴스와 동일한 OperatingSystem 개체를 만듭니다. |
Equals(Object) |
지정된 개체가 현재 개체와 같은지 확인합니다. (다음에서 상속됨 Object) |
Get |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
Get |
사용되지 않음.
이 인스턴스를 역직렬화하는 데 필요한 모든 데이터로 SerializationInfo 개체를 채웁니다. |
Get |
현재 인스턴스의 Type을 가져옵니다. (다음에서 상속됨 Object) |
Is |
현재 애플리케이션이 Android에서 실행되고 있는지 여부를 나타냅니다. |
Is |
Android 버전(Linux 명령 |
Is |
현재 애플리케이션이 브라우저에서 WASM으로 실행되고 있는지 여부를 나타냅니다. |
Is |
현재 애플리케이션이 FreeBSD에서 실행되고 있는지 여부를 나타냅니다. |
Is |
FreeBSD 버전(Linux 명령 |
IsIOS() |
현재 애플리케이션이 iOS 또는 MacCatalyst에서 실행 중인지 여부를 나타냅니다. |
Is |
iOS/MacCatalyst 버전(에서 |
Is |
현재 애플리케이션이 Linux에서 실행되고 있는지 여부를 나타냅니다. |
Is |
현재 애플리케이션이 Mac Catalyst에서 실행 중인지 여부를 나타냅니다. |
Is |
≤ 버전 비교를 사용하여 Mac Catalyst 버전(Apple 설명서에 제시된 iOS 버전)을 확인합니다. 지정된 Mac Catalyst 릴리스에 추가된 API를 보호합니다. |
Is |
현재 애플리케이션이 macOS에서 실행되고 있는지 여부를 나타냅니다. |
Is |
macOS 버전(에서 |
Is |
현재 애플리케이션이 지정된 플랫폼에서 실행되고 있는지 여부를 나타냅니다. |
Is |
운영 체제 버전이 지정된 플랫폼 버전보다 이후 버전이거나 같은지 확인합니다. 이 메서드는 지정된 OS 버전에 추가된 API를 보호하는 데 사용할 수 있습니다. |
Is |
현재 애플리케이션이 tvOS에서 실행되고 있는지 여부를 나타냅니다. |
Is |
tvOS 버전(에서 |
Is |
현재 애플리케이션이 WASI로 실행되고 있는지 여부를 나타냅니다. |
Is |
현재 애플리케이션이 watchOS에서 실행되고 있는지 여부를 나타냅니다. |
Is |
watchOS 버전(에서 |
Is |
현재 애플리케이션이 Windows에서 실행되고 있는지 여부를 나타냅니다. |
Is |
Windows 버전(에서 |
Memberwise |
현재 Object의 단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
To |
이 OperatingSystem 개체의 값을 해당하는 문자열 표현으로 변환합니다. |
제품 | 버전 |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.