OSVersion()

语法

Result = OSVersion()
概要
Returns the version of the operating system on which the program has been launched.

参数

无.

返回值

Returns one of the following values, depending on the OS on which the command run:

Windows
  #PB_OS_Windows_NT3_51
  #PB_OS_Windows_95
  #PB_OS_Windows_NT_4
  #PB_OS_Windows_98
  #PB_OS_Windows_ME
  #PB_OS_Windows_2000
  #PB_OS_Windows_XP
  #PB_OS_Windows_Server_2003
  #PB_OS_Windows_Vista
  #PB_OS_Windows_Server_2008
  #PB_OS_Windows_7
  #PB_OS_Windows_Server_2008_R2
  #PB_OS_Windows_8
  #PB_OS_Windows_Server_2012
  #PB_OS_Windows_Future  ; New Windows version (not existing when the program was written)
Linux
  #PB_OS_Linux_2_2
  #PB_OS_Linux_2_4
  #PB_OS_Linux_2_6
  #PB_OS_Linux_Future  ; New Linux version (not existing when the program was written)
Mac OSX
  #PB_OS_MacOSX_10_0
  #PB_OS_MacOSX_10_1
  #PB_OS_MacOSX_10_2
  #PB_OS_MacOSX_10_3
  #PB_OS_MacOSX_10_4
  #PB_OS_MacOSX_10_5
  #PB_OS_MacOSX_10_6
  #PB_OS_MacOSX_10_7
  #PB_OS_MacOSX_10_8
  #PB_OS_MacOSX_Future  ; New MacOS X version (not existing when the program was written)

示例

  Select OSVersion()
    Case #PB_OS_Windows_98
      MessageRequester("Info", "Windows 98")

    Case #PB_OS_Windows_2000
      MessageRequester("Info", "Windows 2000")

    Case #PB_OS_Windows_XP
      MessageRequester("Info", "Windows XP")

    Default
      MessageRequester("Info", "Unsupported Windows version")
  EndSelect
Note: the value of these constants are established before the release date of each version, therefore tests such as the one which follows, may be used, in order to catch all versions which are older or newer than a given one:
  If OSVersion() < #PB_OS_Windows_2000
    ;
    ; All versions older than Windows 2000
    ;
  EndIf

已支持操作系统

所有

<- MemoryStatus() - System Index - UserName() ->