winform 檢測作業系統版本

2021-09-29 09:58:09 字數 602 閱讀 1563

網上最常見的版本:但是經親測,已經不准了(window的官方版本號說明和實際情況相差較大)

親測有效的版本:

/*

* 下面幾個是我獲取了的幾個版本名稱

* microsoft windows 10 企業版

* microsoft windows server 2008 r2 enterprise

* microsoft windows server 2012 r2 standard

* microsoft windows 7 旗艦版

*/new

computerinfo()

.osfullname;

另附:判斷作業系統是64位還是32位

if

(environment.is64bitoperatingsystem)

else

c 檢測作業系統版本

我們通過system.environment.osversion.version獲得作業系統的版本號,然後再根據版本號進行判斷作業系統是什麼版本 0參考於 注意 在msdn官方文件有說明 osversion 屬性報告兩個相同的版本號 6.2.0.0 windows 8 和 windows 8.1。在...

前端獲取作業系統 作業系統版本

在做埋點的過程中,遇到要上傳作業系統和作業系統版本的需求,如下 通過n igator.useragent獲取首先將作業系統確定為如下對映 all os 獲取當前作業系統 獲取當前作業系統 export const getos if useragent.includes mac else if use...

CMakeLists檢測作業系統

cmakelists檢測作業系統 if cmake system name strequal linux message status configuring on for linux elseif cmake system name strequal darwin message status c...