Mega Code Archive

 
Categories / C# / Development Class
 

Determines if the current version of windows is valid (Vista, 7, Server 2008)

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.Xml.Linq; namespace WEI_Share.Helpers {   public sealed class Utilities   {         public static bool WinsatExecutableExited { get; set; }     /// <summary>     /// Determines if the current version of windows is valid (Vista, 7, Server 2008)     /// </summary>     /// <returns></returns>     public static bool IsValidWindowsVersion()     {       System.OperatingSystem osInfo = System.Environment.OSVersion;       //6 - Vista, 7, Server 2008       if (osInfo.Version.Major == 6)       {                 //windows 7 = 1                 if(osInfo.Version.Minor == 1)             return true;       }       return false;     }   } }