Name
Version
Synopsis
This class represents a version number. The .NET framework uses it as the version of assemblies, operating systems, and network protocols. A version number consists of as many as four parts: a major, minor, build, and revision number. For some applications, such as the HTTP protocol, only the first two numbers (major and minor) are used.
public sealed class Version : ICloneable, IComparable { // Public Constructors public Version( ); public Version(intmajor
, intminor
); public Version(intmajor
, intminor
, intbuild
); public Version(intmajor
, intminor
, intbuild
, intrevision
); public Version(stringversion
); // Public Instance Properties public int Build{get; } public int Major{get; } public int Minor{get; } public int Revision{get; } // Public Static Methods public static bool operator !=(Versionv1
, Versionv2
); public static bool operator <(Versionv1
, Versionv2
); public static bool operator <=(Versionv1
, Versionv2
); public static bool operator = =(Versionv1
, Versionv2
); public static bool operator >(Versionv1
, Versionv2
); public static bool operator >=(Versionv1
, Versionv2
); // Public Instance Methods public object Clone( ); // implements ICloneable public int CompareTo(objectversion
); // implements IComparable public override bool Equals(objectobj
); // overrides object public override int GetHashCode( ); // overrides object public override string ToString( ); // overrides object public string ToString(intfieldCount
); }
Returned By
Environment.Version ...
Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.