OperatingSystemEx
Provides operating system related helper methods and properties.
属性
public static bool IsFramework { get; }
value = OperatingSystemEx.IsFramework
Gets a value indicating whether the current runtime framework is .NET Framework.
public static IEnumerable<OSPlatform> Platforms { get; }
value = OperatingSystemEx.Platforms
Gets all available operating system platforms defined in OSPlatform.
方法
public static IDictionary<string, Version> GetRuntimePackages(Version fwVer)
result = OperatingSystemEx.GetRuntimePackages(fwVer)
Retrieves runtime package versions based on the provided framework version.
- fwVer
- The framework version to look up corresponding runtime packages.
返回值: A dictionary containing the package name as the key and its Version as the value.
public static bool IsLinux()
result = OperatingSystemEx.IsLinux()
Determines whether the current operating system is Linux.
返回值: true if the operating system is Linux; otherwise, false.
public static bool IsMacOS()
result = OperatingSystemEx.IsMacOS()
Determines whether the current operating system is macOS.
返回值: true if the operating system is macOS; otherwise, false.
public static bool IsOSPlatform(OSPlatform platform)
result = OperatingSystemEx.IsOSPlatform(platform)
Determines whether the specified OSPlatform is the current platform.
- platform
- The operating system platform to check.
返回值: true if the specified platform is the current operating system; otherwise, false.
public static bool IsWindows()
result = OperatingSystemEx.IsWindows()
Determines whether the current operating system is Windows.
返回值: true if the operating system is Windows; otherwise, false.