This commit is contained in:
Mn
2023-11-08 16:07:56 +08:00
parent 15c0aa1c5c
commit efaed011e0
16 changed files with 287 additions and 598 deletions

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace NetPanel.Help
{
public class SystemHelp
{
/// <summary>
/// 是否 win系统
/// </summary>
/// <returns></returns>
public static bool IsWindows()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return true;
}
return false;
}
/// <summary>
/// 是否 linux 系统
/// </summary>
/// <returns></returns>
public static bool IsLinux()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return true;
}
return false;
}
/// <summary>
/// 是否MacOs环境
/// </summary>
/// <returns></returns>
public static bool IsOSX()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return true;
}
return false;
}
}
}