I need to keep track of an arbitrary version number in my C# application, which has the form M+.m+.b+, where M is "Major", m is "minor", b is "build", and + indicates that the version number is not restricted to one digit per number.
Is there a built-in class that basically just holds 3 or 4 (the 4th would be the revision number) ints and provides some convenient comparison functions, or do I need to write my own? I imagine it would look something like this:
class VersionNumber { public int Major; public int Minor; public int Build; public int Revision; static public VersionNumber operator >(VersionNumber number) { // Comparison function here. } // Other comparison functions and whatnot here. } 31 Answer
Check this MSDN Link: Version Class. The type System.Version comes with these properties:
- Build
- Major
- MajorRevision
- Minor
- MinorRevision
- Revision