初始化上传
This commit is contained in:
24
常用工具集/Utility/CZGL.SystemInfo/Memory/MemoryHelper.cs
Normal file
24
常用工具集/Utility/CZGL.SystemInfo/Memory/MemoryHelper.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CZGL.SystemInfo
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class MemoryHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取当前系统的内存信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static MemoryValue GetMemoryValue()
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return WindowsMemory.GetMemory();
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
return LinuxMemory.GetMemory();
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user