class Version

in global :: System

Represents the version number of an assembly, operating system, or the common language runtime. This class cannot be inherited.


public Version( int major, int minor )

Initializes a new instance of the class using the specified major and minor values.

  • major The major version number.
  • minor The minor version number.

public Version( int major, int minor, int build )

Initializes a new instance of the class using the specified major, minor, and build values.

  • major The major version number.
  • minor The minor version number.
  • build The build number.

public Version( int major, int minor, int build, int revision )

Initializes a new instance of the class with the specified major, minor, build, and revision numbers.

  • major The major version number.
  • minor The minor version number.
  • build The build number.
  • revision The revision number.

public Version( string version )

Initializes a new instance of the class using the specified string.

  • version A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.').

public int Build { get; }

Gets the value of the build component of the version number for the current object.

  • Returns The build number, or -1 if the build number is undefined.

public int CompareTo( object version )

Compares the current object to a specified object and returns an indication of their relative values.

  • version An object to compare, or .
  • Returns A signed integer that indicates the relative values of the two objects, as shown in the following table. Return value Meaning Less than zero The current object is a version before . Zero The current object is the same version as . Greater than zero The current object is a version subsequent to . -or- is .

public int CompareTo( Version value )

Compares the current object to a specified object and returns an indication of their relative values.

  • value A object to compare to the current object, or .
  • Returns A signed integer that indicates the relative values of the two objects, as shown in the following table. Return value Meaning Less than zero The current object is a version before . Zero The current object is the same version as . Greater than zero The current object is a version subsequent to . -or- is .

public bool Equals( object obj )

Returns a value indicating whether the current object is equal to a specified object.

  • obj An object to compare with the current object, or .
  • Returns if the current object and are both objects, and every component of the current object matches the corresponding component of ; otherwise, .

public bool Equals( Version obj )

Returns a value indicating whether the current object and a specified object represent the same value.

  • obj A object to compare to the current object, or .
  • Returns if every component of the current object matches the corresponding component of the parameter; otherwise, .

public int Major { get; }

Gets the value of the major component of the version number for the current object.

  • Returns The major version number.

public short MajorRevision { get; }

Gets the high 16 bits of the revision number.

  • Returns A 16-bit signed integer.

public int Minor { get; }

Gets the value of the minor component of the version number for the current object.

  • Returns The minor version number.

public short MinorRevision { get; }

Gets the low 16 bits of the revision number.

  • Returns A 16-bit signed integer.

public static bool op_Equality( Version v1, Version v2 )

Determines whether two specified objects are equal.

  • v1 The first object.
  • v2 The second object.
  • Returns if equals ; otherwise, .

public static bool op_GreaterThan( Version v1, Version v2 )

Determines whether the first specified object is greater than the second specified object.

  • v1 The first object.
  • v2 The second object.
  • Returns if is greater than ; otherwise, .

public static bool op_GreaterThanOrEqual( Version v1, Version v2 )

Determines whether the first specified object is greater than or equal to the second specified object.

  • v1 The first object.
  • v2 The second object.
  • Returns if is greater than or equal to ; otherwise, .

public static bool op_Inequality( Version v1, Version v2 )

Determines whether two specified objects are not equal.

  • v1 The first object.
  • v2 The second object.
  • Returns if does not equal ; otherwise, .

public static bool op_LessThan( Version v1, Version v2 )

Determines whether the first specified object is less than the second specified object.

  • v1 The first object.
  • v2 The second object.
  • Returns if is less than ; otherwise, .

public static bool op_LessThanOrEqual( Version v1, Version v2 )

Determines whether the first specified object is less than or equal to the second object.

  • v1 The first object.
  • v2 The second object.
  • Returns if is less than or equal to ; otherwise, .

public static Version Parse( string input )

Converts the string representation of a version number to an equivalent object.

  • input A string that contains a version number to convert.
  • Returns An object that is equivalent to the version number specified in the parameter.

public int Revision { get; }

Gets the value of the revision component of the version number for the current object.

  • Returns The revision number, or -1 if the revision number is undefined.

public string ToString( int fieldCount )

Converts the value of the current object to its equivalent representation. A specified count indicates the number of components to return.

  • fieldCount The number of components to return. The ranges from 0 to 4.
  • Returns The representation of the values of the major, minor, build, and revision components of the current object, each separated by a period character ('.'). The parameter determines how many components are returned. fieldCount Return Value 0 An empty string (""). 1 major 2 major.minor 3 major.minor.build 4 major.minor.build.revision For example, if you create object using the constructor Version(1,3,5), ToString(2) returns "1.3" and ToString(4) throws an exception.

public static bool TryParse( string input, ref Version result )

Tries to convert the string representation of a version number to an equivalent object, and returns a value that indicates whether the conversion succeeded.

  • input A string that contains a version number to convert.
  • result When this method returns, contains the equivalent of the number that is contained in , if the conversion succeeded. If is , , or if the conversion fails, is when the method returns.
  • Returns if the parameter was converted successfully; otherwise, .

public Type GetType( )

😔 No documentation found.

public Version( )

😔 No documentation found.

public bool TryFormat( Span<byte> utf8Destination, ref int bytesWritten )

😔 No documentation found.

public static Version Parse( ReadOnlySpan<char> input )

😔 No documentation found.

public bool TryFormat( Span<byte> utf8Destination, int fieldCount, ref int bytesWritten )

😔 No documentation found.

public bool TryFormat( Span<char> destination, int fieldCount, ref int charsWritten )

😔 No documentation found.

public bool TryFormat( Span<char> destination, ref int charsWritten )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public static bool TryParse( ReadOnlySpan<char> input, ref Version result )

😔 No documentation found.

public object Clone( )

😔 No documentation found.