Action
    Preparing search index...

    Class Version

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

    Hierarchy (View Summary)

    Index

    Constructors

    • Initializes a new instance of the System.Version class.

      Returns Version

    • Initializes a new instance of the System.Version class using the specified string.

      Parameters

      • version: string | String

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

      Returns Version

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

      Parameters

      • major: number | Int32

        The major version number.

      • minor: number | Int32

        The minor version number.

      Returns Version

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

      Parameters

      • major: number | Int32

        The major version number.

      • minor: number | Int32

        The minor version number.

      • build: number | Int32

        The build number.

      Returns Version

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

      Parameters

      • major: number | Int32

        The major version number.

      • minor: number | Int32

        The minor version number.

      • build: number | Int32

        The build number.

      • revision: number | Int32

        The revision number.

      Returns Version

    Accessors

    • get Build(): number

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

      Returns number

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

    • get Major(): number

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

      Returns number

      The major version number.

    • get MajorRevision(): number

      Gets the high 16 bits of the revision number.

      Returns number

      A 16-bit signed integer.

    • get Minor(): number

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

      Returns number

      The minor version number.

    • get MinorRevision(): number

      Gets the low 16 bits of the revision number.

      Returns number

      A 16-bit signed integer.

    • get Revision(): number

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

      Returns number

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

    Methods

    • Casts this object to the specified type. Throws error on failure.

      Type Parameters

      • T1

        The target type of the cast.

      • T2

        The type of the object to cast.

      Parameters

      Returns T1

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

      Parameters

      Returns number

      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 System.Version object is a version before value.

      Zero

      The current System.Version object is the same version as value.

      Greater than zero

      The current System.Version object is a version subsequent to value.

      -or-

      value is null.

    • Determines whether the specified object is equal to the current object.

      Parameters

      • obj: any

        The object to compare with the current object.

      Returns boolean

      true if the specified object is equal to the current object; otherwise, false.

    • Serves as the default hash function.

      Returns number

      A hash code for the current object.

    • Returns a string that represents the current object.

      Returns string

      A string that represents the current object.

    • Casts this object to the specified type. Returns null on failure.

      Type Parameters

      • T1

        The target type of the cast.

      • T2

        The type of the object to cast.

      Parameters

      Returns null | T1

    • Determines whether the specified object instances are considered equal.

      Parameters

      • objA: any

        The first object to compare.

      • objB: any

        The second object to compare.

      Returns boolean

      true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.

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

      Parameters

      • input: string | String

        A string that contains a version number to convert.

      Returns Version

      An object that is equivalent to the version number specified in the input parameter.

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

      Parameters

      • input: string | String

        A string that contains a version number to convert.

      • result: OutParam<Version>

        When this method returns, contains the System.Version equivalent of the number that is contained in input, if the conversion succeeded. If input is null, System.String.Empty, or if the conversion fails, result is null when the method returns.

      Returns boolean

      true if the input parameter was converted successfully; otherwise, false.