增加判断服务器类型;更新初始化数据sql

This commit is contained in:
2020-03-20 18:38:39 +08:00
parent ef6d9100ea
commit 712a7620d6
7 changed files with 2277 additions and 3055 deletions
+28
View File
@@ -12,6 +12,7 @@ using Microsoft.Extensions.Configuration.Json;
using System.Net.NetworkInformation;
using System.Linq;
using System.Net.Sockets;
using System.Runtime.InteropServices;
namespace COMCMS.Common
{
@@ -820,6 +821,33 @@ namespace COMCMS.Common
return price;
}
/// <summary>
/// 获取当前系统运行平台
/// </summary>
/// <returns></returns>
public static string GetOSPlatform()
{
string osPlatform = "Unknown";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
osPlatform = "Windows";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
osPlatform = "Linux";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
osPlatform = "OSX";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
{
osPlatform = "FreeBSD";
}
return osPlatform;
}
#endregion
#region 处理部分