奶头挺立呻吟高潮av全片,成人试看120秒体验区,性欧美极品v,A片高潮抽搐揉捏奶头视频

操作系統

C#檢測操作系統版本的方法

時間:2025-05-30 14:01:12 操作系統 我要投稿
  • 相關推薦

C#檢測操作系統版本的方法匯總

  本文實例為大家分享了C#檢測操作系統版本的方法,供大家參考,具體內容如下

  我們通過System.Environment.OSVersion.Version獲得操作系統的版本號,然后再根據版本號進行判斷操作系統是什么版本。

  Version 類的屬性

  參考于:https://msdn.microsoft.com/zh-cn/library/windows/desktop/ms724834(v=vs.85).aspx

  注意:在msdn官方文檔有說明 → OSVersion 屬性報告兩個相同的版本號 (6.2.0.0) Windows 8 和 Windows 8.1。在某些情況下, OSVersion 屬性可能不會返回與指定的 Windows 程序兼容性模式功能的版本相匹配的操作系統版本。

  代碼:

  public class GetOSystem{private const string Windows2000 = "5.0";private const string WindowsXP = "5.1";private const string Windows2003 = "5.2";private const string Windows2008 = "6.0";private const string Windows7 = "6.1";private const string Windows8OrWindows81 = "6.2";private const string Windows10 = "10.0";private string OSystemName;public void setOSystemName(string oSystemName){this.OSystemName = oSystemName;}public GetOSystem(){switch (System.Environment.OSVersion.Version.Major + "." + System.Environment.OSVersion.Version.Minor){case Windows2000:setOSystemName("Windows2000");break;case WindowsXP:setOSystemName("WindowsXP");break;case Windows2003:setOSystemName("Windows2003");break;case Windows2008:setOSystemName("Windows2008");break;case Windows7:setOSystemName("Windows7");break;case Windows8OrWindows81:setOSystemName("Windows8.OrWindows8.1");break;case Windows10:setOSystemName("Windows10");break;}Console.WriteLine(OSystemName);}}class Program{static void Main(string[] args){#region 檢測系統new GetOSystem();#endregion}}

  輸出結果:

  以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持。

【C#檢測操作系統版本的方法】相關文章:

c#檢測cpu使用率01-02

KMP算法的C#實現方法04-11

獲取當前操作系統的軟件版本08-11

Linux操作系統的十個經典版本08-01

WindowsMobile操作系統手機版本分類對應機型01-26

Linux查看系統版本的方法06-26

快速安裝操作系統的方法07-09

操作系統打補丁的方法06-04

unix操作系統關機方法04-12

主站蜘蛛池模板: 全州县| 柳江县| 巢湖市| 兴业县| 潍坊市| 安图县| 永寿县| 信阳市| 临洮县| 大丰市| 南岸区| 墨玉县| 馆陶县| 常熟市| 江孜县| 缙云县| 正阳县| 鹤庆县| 察哈| 长汀县| 遵义市| 卢龙县| 汉阴县| 伊金霍洛旗| 德令哈市| 九龙城区| 洪泽县| 舟曲县| 平凉市| 宣威市| 大理市| 凤山县| 高唐县| 绥棱县| 牙克石市| 霍林郭勒市| 维西| 比如县| 漳州市| 津市市| 祁门县|