zoukankan      html  css  js  c++  java
  • 获取系统版本

    using System;
    using System.Collections;
    using System.Globalization;
    using System.IO;
    using System.Net;
    using System.Runtime.InteropServices;
    using System.Security.Cryptography;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Web;
    using System.Runtime.Serialization.Formatters.Binary;
    using System.Security.Cryptography.X509Certificates;

    public static string getOSVersion(out int version)
    {
    OperatingSystem os = Environment.OSVersion;
    version = os.Version.Major;
    string label1Text = "";
    switch (os.Platform)
    {
    case PlatformID.Win32Windows:
    switch (os.Version.Minor)
    {
    case 0:
    label1Text = "Windows 95 ";
    break;
    case 10:
    if (os.Version.Revision.ToString() == "2222A ")
    label1Text = "Windows 98 第二版 ";
    else
    label1Text = "Windows 98 ";
    break;
    case 90:
    label1Text = "Windows Me ";
    break;
    }
    break;
    case PlatformID.Win32NT:
    switch (os.Version.Major)
    {
    case 3:
    label1Text = "Windows NT 3.51 ";
    break;
    case 4:
    label1Text = "Windows NT 4.0 ";
    break;
    case 5:
    switch (os.Version.Minor)
    {
    case 0:
    label1Text = "Windows 200 ";
    break;
    case 1:
    label1Text = "Windows XP ";
    break;
    case 2:
    label1Text = "Windows 2003 ";
    break;
    }
    break;
    case 6:
    switch (os.Version.Minor)
    {
    case 0:
    label1Text = "Windows Vista ";
    break;
    case 1:
    label1Text = "Windows 7 ";
    break;
    }
    break;
    }
    break;
    }
    return label1Text;
    }

  • 相关阅读:
    Leetcode:50. Pow(x, n)
    loj 2759「JOI 2014 Final」飞天鼠
    bzoj 3569 DZY Loves Chinese II
    CF407D Largest Submatrix 3
    bzoj 3837 pa2013 Filary
    bzoj 4722 由乃
    CF1105E Helping Hiasat
    loj 6043「雅礼集训 2017 Day7」蛐蛐国的修墙方案
    luogu P2605 [ZJOI2010]基站选址
    luogu P3226 [HNOI2012]集合选数
  • 原文地址:https://www.cnblogs.com/zhshlimi/p/5605492.html
Copyright © 2011-2022 走看看