Determines if the current version of windows is valid (Vista, 7, Server 2008) : Version « Development Class « C# / C Sharp






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;
    }


  }
}

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.A version representing '2.0' does not equal a version representing '2.0.0.0'.
2.A Simple class used to keep track of package version.
3.Gets the major version of the operating system.