System.SysUtils.TOSVersion
Delphi
TOSVersion = record
C++
struct DECLSPEC_DRECORD TOSVersion
{
public:
enum DECLSPEC_DENUM TArchitecture : unsigned char { arIntelX86, arIntelX64, arARM32, arARM64 };
enum DECLSPEC_DENUM TPlatform : unsigned char { pfWindows, pfMacOS, pfiOS, pfAndroid, pfWinRT, pfLinux };
public:
#define TOSVersion_AllArchitectures (System::Set<TArchitecture, TArchitecture::arIntelX86, TArchitecture::arARM64>() << TArchitecture::arIntelX86 << TArchitecture::arIntelX64 << TArchitecture::arARM32 << TArchitecture::arARM64 )
#define TOSVersion_AllPlatforms (System::Set<TPlatform, TPlatform::pfWindows, TPlatform::pfLinux>() << TPlatform::pfWindows << TPlatform::pfMacOS << TPlatform::pfiOS << TPlatform::pfAndroid << TPlatform::pfWinRT << TPlatform::pfLinux )
private:
static TArchitecture FArchitecture;
static int FBuild;
static int FMajor;
static int FMinor;
static System::UnicodeString FName;
static TPlatform FPlatform;
static int FServicePackMajor;
static int FServicePackMinor;
private:
public:
static bool __fastcall Check(int AMajor)/* overload */;
static bool __fastcall Check(int AMajor, int AMinor)/* overload */;
static bool __fastcall Check(int AMajor, int AMinor, int AServicePackMajor)/* overload */;
static System::UnicodeString __fastcall ToString();
/* static */ __property TArchitecture Architecture = {read=FArchitecture};
/* static */ __property int Build = {read=FBuild};
/* static */ __property int Major = {read=FMajor};
/* static */ __property int Minor = {read=FMinor};
/* static */ __property System::UnicodeString Name = {read=FName};
/* static */ __property TPlatform Platform = {read=FPlatform};
/* static */ __property int ServicePackMajor = {read=FServicePackMajor};
/* static */ __property int ServicePackMinor = {read=FServicePackMinor};
private:
};
Eigenschaften
Typ | Sichtbarkeit | Quelle | Unit | Übergeordnet |
---|---|---|---|---|
record struct |
public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Beschreibung
Beschreibt das aktuelle Betriebssystem: Plattform und Version.
Mit TOSVersion ermitteln Sie Informationen über das aktuelle Betriebssystem, wie:
- Plattform (Windows, MAC OS X, iOS, Android oder Linux)
- Version
Weitere Informationen:
- Architektur (Intel x86, Intel x64, ARM 32 oder ARM 64)
- Installiertes Service-Pack
Beispiel:
Writeln(TOSVersion.ToString);
Mögliche Ausgabe:
Windows XP Service Pack 3 (Version 5.1, Build 2600, 32-bit Edition)
oder
Windows 11 (Version 21H2, OS Build 22000.318, 64-bit Edition)
Sie können keine TOSVersion-Variablen erstellen. TOSVersion repräsentiert statische (globale) Daten, die beim Anwendungsstart initialisiert werden.
TOSVersion stellt Methoden zum Überprüfen der Version des Betriebssystems bereit. Siehe die Überladungen von Check.
Hinweis:
Auf der Linux-Plattform ist die Ausgabe die Kernel-Version, nicht die Version des Betriebssystems.
Wenn die Anwendung mit der SDK-Version 10.15 oder früher erzeugt wurde, gibt macOS für macOS 11 und höher 10.16 als eine "kompatible Versionsnummer" zurück.