using System.Runtime.InteropServices; namespace CZGL.SystemInfo { /// /// /// public static class MemoryHelper { /// /// 获取当前系统的内存信息 /// /// public static MemoryValue GetMemoryValue() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return WindowsMemory.GetMemory(); if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) return LinuxMemory.GetMemory(); return default; } } }