Version 클래스

정의

어셈블리, 운영 체제 또는 공용 언어 런타임의 버전 번호를 나타냅니다. 이 클래스는 상속될 수 없습니다.

public ref class Version sealed : IComparable, IComparable<Version ^>, IEquatable<Version ^>
public ref class Version sealed : ICloneable, IComparable, IComparable<Version ^>, IEquatable<Version ^>
public ref class Version sealed : ICloneable, IComparable, IComparable<Version ^>, IEquatable<Version ^>, ISpanFormattable
public ref class Version sealed : ICloneable, IComparable, IComparable<Version ^>, IEquatable<Version ^>, ISpanFormattable, IUtf8SpanFormattable
public ref class Version sealed : ICloneable, IComparable
public sealed class Version : IComparable, IComparable<Version>, IEquatable<Version>
public sealed class Version : ICloneable, IComparable, IComparable<Version>, IEquatable<Version>
public sealed class Version : ICloneable, IComparable, IComparable<Version>, IEquatable<Version>, ISpanFormattable
public sealed class Version : ICloneable, IComparable, IComparable<Version>, IEquatable<Version>, ISpanFormattable, IUtf8SpanFormattable
[System.Serializable]
public sealed class Version : ICloneable, IComparable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class Version : ICloneable, IComparable, IComparable<Version>, IEquatable<Version>
type Version = class
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
type Version = class
    interface ICloneable
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
type Version = class
    interface ICloneable
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
    interface ISpanFormattable
    interface IFormattable
type Version = class
    interface ICloneable
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
    interface IFormattable
    interface ISpanFormattable
type Version = class
    interface ICloneable
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
    interface IFormattable
    interface ISpanFormattable
    interface IUtf8SpanFormattable
type Version = class
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
    interface ICloneable
[<System.Serializable>]
type Version = class
    interface ICloneable
    interface IComparable
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Version = class
    interface ICloneable
    interface IComparable
    interface IComparable<Version>
    interface IEquatable<Version>
Public NotInheritable Class Version
Implements IComparable, IComparable(Of Version), IEquatable(Of Version)
Public NotInheritable Class Version
Implements ICloneable, IComparable, IComparable(Of Version), IEquatable(Of Version)
Public NotInheritable Class Version
Implements ICloneable, IComparable, IComparable(Of Version), IEquatable(Of Version), ISpanFormattable
Public NotInheritable Class Version
Implements ICloneable, IComparable, IComparable(Of Version), IEquatable(Of Version), ISpanFormattable, IUtf8SpanFormattable
Public NotInheritable Class Version
Implements ICloneable, IComparable
상속
Version
특성
구현

예제

다음 예제에서는 특성을 사용하여 AssemblyVersionAttribute 어셈블리에 버전 번호를 할당합니다. 컴파일 시 이 버전 정보는 어셈블리의 메타데이터와 함께 저장됩니다. 런타임에 예제는 실행 중인 어셈블리에 대한 참조를 가져오기 위해 어셈블리에 있는 형식의 속성 값을 Type.Assembly 검색하고 메서드에서 반환 Assembly.GetName 된 개체의 속성에서 Version 어셈블리의 AssemblyName 버전 정보를 검색합니다.

using System;
using System.Reflection;

[assembly:AssemblyVersionAttribute("2.0.1")]

public class Example1
{
   public static void Main()
   {
      Assembly thisAssem = typeof(Example1).Assembly;
      AssemblyName thisAssemName = thisAssem.GetName();
       
      Version ver = thisAssemName.Version;
       
      Console.WriteLine("This is version {0} of {1}.", ver, thisAssemName.Name);    
   }
}
// The example displays the following output:
//        This is version 2.0.1.0 of Example1.
open System.Reflection

[<assembly: AssemblyVersionAttribute "2.0.1">]
do ()

type Example1 = class end

let thisAssem = typeof<Example1>.Assembly
let thisAssemName = thisAssem.GetName()
   
let ver = thisAssemName.Version
   
printfn $"This is version {ver} of {thisAssemName.Name}."
// The example displays the following output:
//        This is version 2.0.1.0 of Example1.
Imports System.Reflection

<Assembly:AssemblyVersionAttribute("2.0.1")>
Module Example1
   Public Sub Main()
       Dim thisAssem As Assembly = GetType(Example1).Assembly
       Dim thisAssemName As AssemblyName = thisAssem.GetName()
       
       Dim ver As Version = thisAssemName.Version
       
       Console.WriteLine("This is version {0} of {1}.", ver, thisAssemName.Name)    
   End Sub
End Module
' The example displays the following output:
'      This is version 2.0.1.0 of Example1.

설명

이 API에 대한 자세한 내용은 버전에 대한 추가 API 설명을 참조하세요.

생성자

Version()

Version 클래스의 새 인스턴스를 초기화합니다.

Version(Int32, Int32)

지정된 주 버전 및 부 버전 값을 사용하여 Version 클래스의 새 인스턴스를 초기화합니다.

Version(Int32, Int32, Int32)

지정된 주 버전, 부 버전 및 빌드 버전 값을 사용하여 Version 클래스의 새 인스턴스를 초기화합니다.

Version(Int32, Int32, Int32, Int32)

지정된 주 버전, 부 버전, 빌드 버전 및 수정 버전 번호를 사용하여 Version 클래스의 새 인스턴스를 초기화합니다.

Version(String)

지정된 문자열을 사용하여 Version 클래스의 새 인스턴스를 초기화합니다.

속성

Build

현재 Version 개체에 대한 버전 번호의 빌드 버전 구성 요소 값을 가져옵니다.

Major

현재 Version 개체에 대한 버전 번호의 주 버전 구성 요소 값을 가져옵니다.

MajorRevision

수정 버전 번호의 상위 16비트를 가져옵니다.

Minor

현재 Version 개체에 대한 버전 번호의 부 버전 구성 요소 값을 가져옵니다.

MinorRevision

수정 버전 번호의 하위 16비트를 가져옵니다.

Revision

현재 Version 개체에 대한 버전 번호의 수정 버전 구성 요소 값을 가져옵니다.

메서드

Clone()

현재 Version 개체와 같은 값을 갖는 새 Version 개체를 반환합니다.

CompareTo(Object)

현재 Version 개체를 지정된 개체와 비교하여 상대 값의 표시를 반환합니다.

CompareTo(Version)

현재 Version 개체를 지정된 Version 개체와 비교하여 상대 값의 표시를 반환합니다.

Equals(Object)

현재 Version 개체가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

Equals(Version)

현재 Version 개체와 지정된 Version 개체의 값이 같은지 여부를 나타내는 값을 반환합니다.

GetHashCode()

현재 Version 개체의 해시 코드를 반환합니다.

GetType()

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

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

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

(다음에서 상속됨 Object)
Parse(ReadOnlySpan<Char>)

동등한 Version 개체에 대해 버전 번호를 나타내는 문자의 지정된 읽기 전용 범위를 변환합니다.

Parse(String)

버전 번호의 문자열 표현을 해당하는 Version 개체로 변환합니다.

ToString()

현재 Version 개체의 값을 해당하는 String 표현으로 변환합니다.

ToString(Int32)

현재 Version 개체의 값을 해당하는 String 표현으로 변환합니다. 지정된 개수는 반환할 구성 요소의 수를 나타냅니다.

TryFormat(Span<Byte>, Int32)

이 버전 instance 바이트 범위로 서식을 지정하려고 시도합니다.

TryFormat(Span<Byte>, Int32, Int32)

이 버전 instance 바이트 범위로 서식을 지정하려고 시도합니다.

TryFormat(Span<Char>, Int32)

이 버전 인스턴스의 형식을 문자 범위로 지정합니다.

TryFormat(Span<Char>, Int32, Int32)

이 버전 인스턴스의 형식을 문자 범위로 지정합니다.

TryParse(ReadOnlySpan<Char>, Version)

동등한 Version 개체에 대해 버전 번호를 나타내는 지정된 문자의 읽기 전용 범위를 변환하려고 시도하고, 변환에 성공했는지 여부를 나타내는 값을 반환합니다.

TryParse(String, Version)

버전 번호의 문자열 표현을 해당하는 Version 개체로 변환하려고 시도하고, 변환에 성공했는지 여부를 나타내는 값을 반환합니다.

연산자

Equality(Version, Version)

지정된 두 Version 개체가 같은지 여부를 확인합니다.

GreaterThan(Version, Version)

지정된 첫 번째 Version 개체가 지정된 두 번째 Version 개체보다 큰지 여부를 확인합니다.

GreaterThanOrEqual(Version, Version)

지정된 첫 번째 Version 개체가 지정된 두 번째 Version 개체보다 크거나 같은지 여부를 확인합니다.

Inequality(Version, Version)

지정된 두 Version 개체가 같지 않은지 여부를 확인합니다.

LessThan(Version, Version)

지정된 첫 번째 Version 개체가 지정된 두 번째 Version 개체보다 작은지 여부를 확인합니다.

LessThanOrEqual(Version, Version)

지정된 첫 번째 Version 개체가 두 번째 Version 개체보다 작거나 같은지 여부를 확인합니다.

명시적 인터페이스 구현

IComparable.CompareTo(Object)

현재 Version 개체를 지정된 개체와 비교하여 상대 값의 표시를 반환합니다.

IFormattable.ToString(String, IFormatProvider)

지정된 형식을 사용하여 현재 인스턴스 값의 형식을 지정합니다.

ISpanFormattable.TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

현재 instance 값의 형식을 제공된 문자 범위로 지정하려고 합니다.

IUtf8SpanFormattable.TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

현재 instance 값의 형식을 제공된 바이트 범위로 UTF-8로 지정하려고 합니다.

적용 대상