You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
895 B
27 lines
895 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Apewer
|
|
{
|
|
|
|
/// <summary>系统实用工具。</summary>
|
|
public class SystemUtility
|
|
{
|
|
|
|
#if NETSTD || NETCORE
|
|
|
|
/// <summary>当前操作系统是 Windows。</summary>
|
|
public static bool IsWindows { get => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows); }
|
|
|
|
/// <summary>当前操作系统是 OS X 或 macOS。</summary>
|
|
public static bool IsOSX { get => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX); }
|
|
|
|
/// <summary>当前操作系统是 Linux。</summary>
|
|
public static bool IsLinux { get => System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Linux); }
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|