A version representing '2.0' does not equal a version representing '2.0.0.0'. : Version « Development Class « C# / C Sharp






A version representing '2.0' does not equal a version representing '2.0.0.0'.

  

using System; 

namespace Samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Version version1 = new Version(2, 0);
            Version version2 = new Version(2, 0, 0);
            Version version3 = new Version(2, 0, 0, 0);
            Console.WriteLine(version1.Equals(version2));
            Console.WriteLine(version1.Equals(version3));
            Console.WriteLine(version2.Equals(version3));
        }
    }
}

   
    
  








Related examples in the same category

1.A Simple class used to keep track of package version.
2.Determines if the current version of windows is valid (Vista, 7, Server 2008)
3.Gets the major version of the operating system.