Gets the major version of the operating system.
//-----------------------------------------------------------------------
// <copyright file="Utility.cs" company="ParanoidMike">
// Copyright (c) ParanoidMike. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ParanoidMike
{
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using Microsoft.Win32;
/// <summary>
/// Reusable functions for many uses.
/// </summary>
public static class Utility
{
/// <summary>
/// Gets the major version of the operating system.
/// </summary>
public static int OSVersion
{
get
{
OperatingSystem os = Environment.OSVersion;
return os.Version.Major;
}
}
}
}
Related examples in the same category