獲取作業系統型別

2021-05-24 10:07:30 字數 978 閱讀 5225

新增自定義型別,用作判斷系統型別,

type

tosversion = (osunknown, os95, os98, osme, osnt3, osnt4, os2k, osxp, os2k3);

新增自定義函式過程

function getos: tosversion; //獲得系統型別,用來取得托盤控制代碼

varos: tosversioninfo;

begin

zeromemory(@os, sizeof(os));

os.dwosversioninfosize := sizeof(os);

getversionex(os);

result := osunknown;

if os.dwplatformid = ver_platform_win32_nt then begin

case os.dwmajorversion of

3: result := osnt3;

4: result := osnt4;

5: begin

case os.dwminorversion of

0: result := os2k;

1: result := osxp;

2: result := os2k3;

end;

end;

end;

endelse if (os.dwmajorversion = 4) and (os.dwminorversion = 0) then

result := os95

else if (os.dwmajorversion = 4) and (os.dwminorversion = 10) then

result := os98

else if (os.dwmajorversion = 4) and (os.dwminorversion = 90) then

result := osme

end;

php獲取當前作業系統型別 PHP OS

如果你想判斷當前的系統型別,那麼可以使用 php os 常量。例如如下 echo php os 輸出 winnt 那麼我們可以這樣 define is win strstr php os,win 1 0 在tp3.2中看到就順便拿上來了 定義乙個常量is win,來判斷系統型別,這樣我們就可以方便了...

作業系統型別

概述 作業系統型別,按應用領域不同,作業系統可分為 桌面作業系統 伺服器作業系統 嵌入式作業系統。桌面作業系統 主要用於個人計算機,從硬體架構可以區分為pc機與mac 蘋果 機。pc相容機 由不同廠家生產的具有相同架構的加算機 ibm提出 cpu架構分為 x86架構 intel amd arm架構 ...

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

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