Version currentFramework = System.Environment.Version; Console.WriteLine("Current .NET Framework version: " + currentFramework.ToString());
Version v1 = new Version("1.2.3"); Version v2 = new Version("1.2.4"); int comparison = v1.CompareTo(v2); if (comparison < 0) { Console.WriteLine(v1 + " is less than " + v2); }This code creates two Version objects representing two different version numbers. It then uses the CompareTo() method to compare them and outputs a message indicating which version number is greater than the other. Package Library: mscorlib.dll